Using .htpasswd and/or https with http.post

​​Hello,

When my agent receives data from the device code, I’d like to post the data to my PHP web server. I have some questions about using http.post in agent code:

  1. Is there a way to supply an .htpasswd user-name / password combination with an http post?

This would allow my web server to be sure that the post came from a legitimate imp, since it knows the password.

  1. I’d like to use https so that the post will be encrypted. The documentation states that an https URL can be used with http.post. My server has other, non-IMP code that uses https to connect to it. Up until now, I’ve been using a self-signed certificate on my server because the only https connections are from devices that “know” the server. In each case, I have an exported, self-signed certificate installed on the client machine, so the client knows that the server is trusted. Now I’d like to post to the same server using an IMP agent. Does agent http.post code require certificates signed by trusted services (if so, which ones?), or is it also possible to set up an encrypted connection to my server that uses a self-signed certificate?

This would allow my imp to be sure that it is connecting to a legitimate web server. Also, It would allow the imp to send the password encrypted, so it isn’t in the clear.

  1. If these things are not possible, is there a good alternative way of posting data to my PHP web server in a relatively secure manner?

Thank you and
Have a lovely week/end,
…Meredith.​