HTTPS support status

Jul 15, 2013 at 10:27 PM
Edited Jul 16, 2013 at 1:57 PM
Hi.

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

Thanks,

Eduardo
Coordinator
Jul 16, 2013 at 4: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.

Thanks,
Steve
Jul 22, 2013 at 10:48 PM
Steve,
Is there an example on how to pass the certificate to the HTTPS on Windows?
Curt
Coordinator
Jul 24, 2013 at 5: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.

Thanks,
Steve
Dec 30, 2013 at 12: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.
Coordinator
Jan 3, 2014 at 1: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?

Thanks,
Steve
Sep 23, 2014 at 8: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.

Thanks.
Coordinator
Sep 23, 2014 at 9: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?

Thanks,
Steve
Sep 23, 2014 at 10:19 PM
My question is https work on Linux ? because I saw https feature vote on https://casablanca.codeplex.com/workitem/274, 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.

Thanks.
Coordinator
Sep 23, 2014 at 10: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.

Thanks,
Steve