Skip to content

Commit ed02a30

Browse files
authored
Merge pull request #220 from lightbend/onlyLoadTracingContextIfNeeded
Only insert tracing context when debugging is used
2 parents dd3a4cb + 056d45e commit ed02a30

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

documentation/src/main/paradox/DebuggingSSL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
In the event that an HTTPS connection does not go through, debugging JSSE can be a hassle.
44

5+
@@@ warning
6+
7+
Enabling debugging wraps the regular SSLContext into a tracing SSLContext.
8+
This means any code that relied on `instanceOf` checks of the old SSLContext
9+
will start behaving differently when debugging is enabled.
10+
For example this appears to be the case when trying to use this module
11+
with the Jetty ALPN agent.
12+
13+
@@@
14+
515
@@@ note
616

717
Prior to 0.4.0, the debug system relied on undocumented modification of internal JSSE debug settings that were normally set using

ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/SSLContextBuilder.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ class ConfigSSLContextBuilder(
122122
} else Nil
123123

124124
val context = buildSSLContext(info.protocol, keyManagers, trustManagers, info.secureRandom)
125-
new TracingSSLContext(context, info.debug)(mkLogger)
125+
if (info.debug.enabled) new TracingSSLContext(context, info.debug)(mkLogger)
126+
else context
126127
}
127128

128129
def buildSSLContext(

0 commit comments

Comments
 (0)