HTTPS support status

Jul 15, 2013 at 11:27 PM
Edited Jul 16, 2013 at 2:57 PM

What is the current Casablanca HTTPS support?
I would like to use it on Windows and Linux. Client certificate is a requirement also.


Jul 16, 2013 at 5:31 PM
Hi Eduardo,

We support HTTPS on Windows, but not yet on Linux. To use it all you have to do is specify a URI with https as the scheme when constructing the http_client. We are currently working on HTTPS on Linux and hopefully should have it ready for our next release. We don't have support for client side certificates right now. Is this a blocking feature for you?

I opened a feature request to track client certificates. Vote for if it is a blocking issue for you.

Jul 22, 2013 at 11:48 PM
Is there an example on how to pass the certificate to the HTTPS on Windows?
Jul 24, 2013 at 6:15 PM
Hi Curt,

No I don't have an example off hand on how to use client certificates with WinHttp. Take a look at this link it describes how it can be done. Basically you are going to have to add a check after initially sending the request to see if the server requests a certificate and the choose the appropriate one and resend the request.

Dec 30, 2013 at 1:55 PM
Hi Steve,

Yes, I am trying to request a HTTPS Url as suggested by you i.e setting URI with https scheme while creating http_client. My request is JSON request but I am getting an exception, whereas I can call the server by a HTTP request (i.e setting URI with http scheme while creating http_client) and getting server response successfully.

I am catching exception in http_exception where message has only "HTTP" as exception message (ex.what())

I am using Casablanca 1.2 version

Please suggest.
Jan 3, 2014 at 2:53 PM
Hi Rathi8579,

Yes that is a bug in the error message "HTTP", that we have fixed since. The http_exception class also contains a std::error_code field. Can you take a look at what the error code value is, http_exception::error_code().value()? Also are you sure the service you are trying to connect to supports HTTPS?

Sep 23, 2014 at 9:42 PM
Hi, Steve,

When will the feature of https on Linux be available ? I tried on Windows, it works. However, with the same code on Linux, it returns the error the same as http on Windows with the following message:

{"name":"Not authorized", "MajorErrorCode":401}

Really need this feature before we can commit to use this package.

Sep 23, 2014 at 10:48 PM
Hi akimboster,

This discussion thread is quite old, from over a year ago. I think it would be better to start a new one.

I'm not entirely sure what you are asking. What feature are you looking for?

Sep 23, 2014 at 11:19 PM
My question is https work on Linux ? because I saw https feature vote on, that leads me to think https does not work on Linux.

Therefore I did a test:

I tried https://<ip>/login on Linux with correct cred; however it tells me with the response "Not Authorized". I tried the same code on Windows, it gives me a session back. However, if I use http on Windows, I get the same response of "Not authorized". That makes me to think Linux does not handle https and convert it to http.

I might be wrong about this assumption. Please clarify.

Sep 23, 2014 at 11:26 PM
Hi akimboster,

Ok are you talking about the http_client or the http_listener? Yes we don't have https supported on the http_listener on non Windows platforms right now. HTTPS is supported for the http_client on all platforms, however we didn't implement support for credentials yet. That is different than HTTPS. See existing feature request here. Depending on what kind of authentication you are trying to do you can do it yourself in the headers as well.