File tree Expand file tree Collapse file tree
main/java/io/opentelemetry/exporter/internal
test/java/io/opentelemetry/exporter/internal
sender/okhttp/src/test/java/io/opentelemetry/exporter/sender/okhttp/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77#### Exporters
88
9- * OTLP: Fix OkHttp HTTP sender dropping client certificates when client TLS is configured without custom trusted certificates.
9+ * Fix OkHttp client mTLS when using the platform default trust store( [ # 8565 ] ( https://github.com/open-telemetry/opentelemetry-java/pull/8565 ) )
1010
1111## Version 1.63.0 (2026-06-05)
1212
Original file line number Diff line number Diff line change @@ -111,8 +111,7 @@ public X509TrustManager getTrustManager() {
111111 return trustManager ;
112112 }
113113
114- @ Nullable
115- public X509TrustManager getEffectiveTrustManager () throws SSLException {
114+ private X509TrustManager getEffectiveTrustManager () throws SSLException {
116115 if (trustManager != null ) {
117116 return trustManager ;
118117 }
Original file line number Diff line number Diff line change @@ -97,19 +97,6 @@ void setSslContext_AlreadyExists_Throws() throws Exception {
9797 .hasMessageContaining ("sslContext or trustManager has been previously configured" );
9898 }
9999
100- @ Test
101- void getEffectiveTrustManager_returnsConfiguredTrustManager ()
102- throws CertificateEncodingException , SSLException {
103- helper .setTrustManagerFromCerts (serverTls .certificate ().getEncoded ());
104-
105- assertThat (helper .getEffectiveTrustManager ()).isSameAs (helper .getTrustManager ());
106- }
107-
108- @ Test
109- void getEffectiveTrustManager_returnsDefaultTrustManager () throws SSLException {
110- assertThat (helper .getEffectiveTrustManager ()).isNotNull ();
111- }
112-
113100 @ Test
114101 void getSslContext_wrapsDefaultTrustManagerFailure () {
115102 String originalAlgorithm = Security .getProperty ("ssl.TrustManagerFactory.algorithm" );
Original file line number Diff line number Diff line change 77
88import static org .assertj .core .api .Assertions .assertThat ;
99import static org .assertj .core .api .Assertions .assertThatThrownBy ;
10+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
1011
1112import io .opentelemetry .sdk .common .export .HttpResponse ;
1213import io .opentelemetry .sdk .common .export .MessageWriter ;
@@ -70,22 +71,21 @@ void constructor_usesDefaultTrustManagerWhenTrustManagerIsNull() throws Exceptio
7071 SSLContext sslContext = SSLContext .getInstance ("TLS" );
7172 sslContext .init (null , null , null );
7273
73- OkHttpHttpSender sender =
74- new OkHttpHttpSender (
75- URI .create ("https://localhost" ),
76- "text/plain" ,
77- null ,
78- Duration .ofSeconds (10 ),
79- Duration .ofSeconds (10 ),
80- Collections ::emptyMap ,
81- null ,
82- null ,
83- sslContext ,
84- null ,
85- null ,
86- Long .MAX_VALUE );
87-
88- assertThat (sender ).isNotNull ();
74+ assertDoesNotThrow (
75+ () ->
76+ new OkHttpHttpSender (
77+ URI .create ("https://localhost" ),
78+ "text/plain" ,
79+ null ,
80+ Duration .ofSeconds (10 ),
81+ Duration .ofSeconds (10 ),
82+ Collections ::emptyMap ,
83+ null ,
84+ null ,
85+ sslContext ,
86+ null ,
87+ null ,
88+ Long .MAX_VALUE ));
8989 }
9090
9191 @ Test
You can’t perform that action at this time.
0 commit comments