[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: https with userid and password



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


I am trying to use Example4 modified with the URL and data I have to send.
The problem is that I have to provide user id and password and I get error
401 - This page requires a userid and password.
The first parameter of http_url_post is:
https://utieditestuser:usertestediuti@xxxxxxxxxxxxxxxxxxxxxxx/import. . . .

HTTPAPI doesn't use the userid & password from the URL. Now that you mention it, that's kinda silly... HTTPAPI *should* do that. But it doesn't, you have to send the userid and password separately with http_setAuth()


For example:

           callp http_setAuth( HTTP_AUTH_BASIC
                             : 'utieditestuser'
                             : 'usertestediuti')

rc = http_url_post('apps2.tradegate2000.com/import. . . .

Do you have any suggestion where I should look for problems?
I have created the CA store, but only the application for Example3 and no
certificate. The other party does not require a certificate.

This isn't an SSL problem. (You couldn't get a 401 error if SSL wasn't working, there'd be no connection to send the error message over.)



Do I have to call http_setauth after the first https_url_post?

If you're using DIGEST authentication (which is rare) you have to call http_url_post FIRST in order to get some info that's used in the cryptography. However, with BASIC authentication (which is what pretty much everyone uses) that's not necessary, you can call http_setauth() prior to making the POST request (and therefore, you don't have to do it twice!)


See code example above.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------