Confusion in documentation regarding HTTPS support in Akka HTTP

76 views
Skip to first unread message

Henrik Larsson

unread,
May 8, 2017, 2:08:05 AM5/8/17
to Akka User List
Im trying to get a Akka HTTP client setup to use HTTPS and certificates. However, what I dont understand is the difference between HttpsContext and using SSL config as explained in http://doc.akka.io/docs/akka-http/current/scala/http/client-side/client-https-support.html
Do i have to use both or do I use one or the other that is they do the same thing but in two different ways?

My guess right now is that they do the same thing but the part under SSL-Config sets up the system default HttpsContext, is this correct?

Konrad Malawski

unread,
May 8, 2017, 2:09:26 AM5/8/17
to akka...@googlegroups.com, Henrik Larsson
My guess right now is that they do the same thing but the part under SSL-Config sets up the system default HttpsContext, is this correct?

Yes, that's the case.

SSLConfig is merely a helper utility you can use to easily set up things. You can not use it if you don't want to.


-- 

Konrad `ktoso` Malawski
Akka @ Lightbend

Henrik Larsson

unread,
May 8, 2017, 2:18:18 AM5/8/17
to Akka User List, favetel...@gmail.com
Ok thanks, so far I have found this example wich i guess i can make work on the client side also https://github.com/rklaehn/akkahttpsserver/blob/master/src/main/scala/httpsserver/Server.scala
However I would like to send the key and crt separate and in the exampel they use p12. Is there any example on how to configure with a case like this?

Konrad Malawski

unread,
May 8, 2017, 2:19:19 AM5/8/17
to akka...@googlegroups.com, Henrik Larsson
It's plain Java, configure the SSLContext as usual and provide it to the HttpsConnectionContext.

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Henrik Larsson

unread,
May 8, 2017, 6:52:06 AM5/8/17
to Akka User List, favetel...@gmail.com
Nice thanks I got it working now! However is there a way to set HTTPS settings on the Http().singleRequest? The docs says it uses the default but i just want to set the HTTPS setting on this speficic request, all others should have another setting.

Konrad Malawski

unread,
May 8, 2017, 7:10:57 AM5/8/17
to akka...@googlegroups.com, Henrik Larsson
Sure, explore it's parameters (HttpsConnectionContext) :-)

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend

Konrad Malawski

unread,
May 8, 2017, 7:11:10 AM5/8/17
to akka...@googlegroups.com, Henrik Larsson
As documented:

* If an explicit [[ConnectionContext]] is given then it rather than the configured default [[ConnectionContext]] will be used
* for setting up the HTTPS connection pool, if the request is targeted towards an `https` endpoint.

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend

On 8 May 2017 at 19:52:09, Henrik Larsson (favetel...@gmail.com) wrote:

Reply all
Reply to author
Forward
0 new messages