akka / akka/akka-http

Http client tries to create AkkaSSLConfig even if I want to an http request

Open
#1,978 2 comments 0 reactions 0 assignees View on GitHub
discuss t:tls
Dominant language
Scala
Stars
1.4k
Forks
584
Avg merge
14h 33m
Merged PRs (30d)
24

Description

Even when I was trying to perform an HTTP request (not HTTPS) during the Http creation, internally it is trying to create a com.typesafe.sslconfig.akka.AkkaSSLConfig instance and because of that I am receiving certification issues.

I am running a simple code like

`val x = Http()`

in the IBM Websphere 8 and probably there are some JVM system properties previously configured.

The error I am receiving is:

```
java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.ag)
at java.security.Provider$Service.newInstance(Provider.java:1628)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:248)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:176)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:30)
at javax.net.ssl.SSLContext.getDefault(SSLContext.java:27)
at com.typesafe.sslconfig.ssl.Ciphers$.java17RecommendedCiphers$lzycompute(Ciphers.scala:29)
at com.typesafe.sslconfig.ssl.Ciphers$.java17RecommendedCiphers(Ciphers.scala:28)
at com.typesafe.sslconfig.ssl.Ciphers$anonfun$recommendedCiphers$2.apply(Ciphers.scala:26)
at com.typesafe.sslconfig.ssl.Ciphers$anonfun$recommendedCiphers$2.apply(Ciphers.scala:26)
at com.typesafe.sslconfig.ssl.package$.foldVersion(package.scala:39)
at com.typesafe.sslconfig.ssl.Ciphers$.recommendedCiphers(Ciphers.scala:24)
at com.typesafe.sslconfig.akka.AkkaSSLConfig.configureCipherSuites(AkkaSSLConfig.scala:186)
at com.typesafe.sslconfig.akka.AkkaSSLConfig.(AkkaSSLConfig.scala:90)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:29)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:19)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:917)
at akka.actor.ExtensionId$class.apply(Extension.scala:79)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:24)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:19)
at akka.http.scaladsl.HttpExt.(Http.scala:51)
at akka.http.scaladsl.Http$.createExtension(Http.scala:928)
at akka.http.scaladsl.Http$.createExtension(Http.scala:804)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:917)
at akka.actor.ExtensionId$class.apply(Extension.scala:79)
at akka.http.scaladsl.Http$.apply(Http.scala:923)
at com.avaya.ept.snapins.scalatemplate.web.RecordServlet.doPost(RecordServlet.scala:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3951)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1014)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: java.security.KeyStoreException: IBMKeyManager: Problem accessing key store java.io.IOException: Keystore was tampered with, or password was incorrect
at com.ibm.jsse2.ae.a(ae.java:112)
at com.ibm.jsse2.ag.g(ag.java:19)
at com.ibm.jsse2.ag.(ag.java:1)
at sun.reflect.GeneratedConstructorAccessor493.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at java.security.Provider$Service.newInstance(Provider.java:1606)
… 53 more
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing Http.apply/createExtension in Http.scala to the AkkaSSLConfig application shown in the stack trace, then inspect AkkaSSLConfig.scala and Ciphers.scala. Reproduce with the reported IBM WebSphere/JVM setup if available; done means plain Http() no longer fails from SSL initialization while HTTPS behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.