GeezerVison is showing github.com — Use empty string instead of null for endpoint identification algorith… · grpc/grpc-java@097a46b
File tree
Expand file treeCollapse file tree
Open diff view settings
main/java/io/grpc/xds/internal/security/trust test/java/io/grpc/xds/internal/security/trust
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: xds/src/main/java/io/grpc/xds/internal/security/trust/XdsX509TrustManager.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -229,7 +229,7 @@ public void checkServerTrusted(X509Certificate[] chain, String authType, Socket |
229 | 229 | SSLSocket sslSocket = (SSLSocket) socket; |
230 | 230 | SSLParameters sslParams = sslSocket.getSSLParameters(); |
231 | 231 | if (sslParams != null) { |
232 | | - sslParams.setEndpointIdentificationAlgorithm(null); |
| 232 | + sslParams.setEndpointIdentificationAlgorithm(""); |
233 | 233 | sslSocket.setSSLParameters(sslParams); |
234 | 234 | } |
235 | 235 | } |
@@ -242,7 +242,7 @@ public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngi |
242 | 242 | throws CertificateException { |
243 | 243 | SSLParameters sslParams = sslEngine.getSSLParameters(); |
244 | 244 | if (sslParams != null) { |
245 | | - sslParams.setEndpointIdentificationAlgorithm(null); |
| 245 | + sslParams.setEndpointIdentificationAlgorithm(""); |
246 | 246 | sslEngine.setSSLParameters(sslParams); |
247 | 247 | } |
248 | 248 | delegate.checkServerTrusted(chain, authType, sslEngine); |
|
Collapse file
Copy file name to clipboardExpand all lines: xds/src/test/java/io/grpc/xds/internal/security/trust/XdsX509TrustManagerTest.java +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -534,6 +534,7 @@ public void checkServerTrustedSslEngine() |
534 | 534 | CertificateUtils.toX509Certificates(TlsTesting.loadCert(SERVER_1_PEM_FILE)); |
535 | 535 | trustManager.checkServerTrusted(serverCerts, "ECDHE_ECDSA", sslEngine); |
536 | 536 | verify(sslEngine, times(1)).getHandshakeSession(); |
| 537 | + assertThat(sslEngine.getSSLParameters().getEndpointIdentificationAlgorithm()).isEmpty(); |
537 | 538 | } |
538 | 539 |
|
539 | 540 | @Test |
@@ -561,6 +562,7 @@ public void checkServerTrustedSslSocket() |
561 | 562 | trustManager.checkServerTrusted(serverCerts, "ECDHE_ECDSA", sslSocket); |
562 | 563 | verify(sslSocket, times(1)).isConnected(); |
563 | 564 | verify(sslSocket, times(1)).getHandshakeSession(); |
| 565 | + assertThat(sslSocket.getSSLParameters().getEndpointIdentificationAlgorithm()).isEmpty(); |
564 | 566 | } |
565 | 567 |
|
566 | 568 | @Test |
|