Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1854

How to specify apache login credentials in ruby HTTP:post_response call

$
0
0

I have a redmine (5.1.9) server running on apache (2.4). When processing email replies, it fails trying to post an HTTP request to itself. I believe this happens because the apache server itself requires an authenticated user, which may have different credentials from the redmine user.

The request is in the module extra/mail_handler/rdm-mailhandler.rb, and looks like:

response = Net::HTTPS.post_form(URI.parse(uri), data, headers, :no_check_certificate => no_check_certificate, :certificate_bundle => certificate_bundle)

Unfortunately, I am not well-versed in ruby or redmine.How do I add a username and password for the apache server to this request? I don't know the keys for the data hash object which the HTTPS.post_form call will look for. Do I have to create some sort of credentials object, or can I simply append them to the existing data object used in the call? I'm pretty much in the dark here.

Also, how could I get some diagnostic output, both for the input parameters (uri, data) and from the post_form call?

Edit: I tried adding:

data[:user] = 'my-user'data[:password] = 'my-pw'

before the call but it didn't change anything.


Viewing all articles
Browse latest Browse all 1854

Trending Articles