|
16 | 16 |
|
17 | 17 | package org.springframework.cloud.gateway.config;
|
18 | 18 |
|
| 19 | +import java.io.IOException; |
19 | 20 | import java.security.KeyStore;
|
20 | 21 | import java.security.KeyStoreException;
|
21 | 22 | import java.security.NoSuchAlgorithmException;
|
| 23 | +import java.security.cert.CertificateException; |
22 | 24 | import java.util.List;
|
23 | 25 | import java.util.Set;
|
24 | 26 | import java.util.function.Supplier;
|
|
190 | 192 | * @author Mete Alpaslan Katırcıoğlu
|
191 | 193 | * @author Alberto C. Ríos
|
192 | 194 | * @author Olga Maciaszek-Sharma
|
193 |
| - * @author Dominic Niemann |
194 | 195 | */
|
195 | 196 | @Configuration(proxyBeanMethods = false)
|
196 | 197 | @ConditionalOnProperty(name = "spring.cloud.gateway.enabled", matchIfMissing = true)
|
@@ -359,10 +360,12 @@ public JsonToGrpcGatewayFilterFactory jsonToGRPCFilterFactory(GrpcSslConfigurer
|
359 | 360 | @ConditionalOnMissingBean(GrpcSslConfigurer.class)
|
360 | 361 | @ConditionalOnClass(name = "io.grpc.Channel")
|
361 | 362 | public GrpcSslConfigurer grpcSslConfigurer(HttpClientProperties properties, SslBundles bundles)
|
362 |
| - throws KeyStoreException, NoSuchAlgorithmException { |
| 363 | + throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { |
363 | 364 | TrustManagerFactory trustManagerFactory = TrustManagerFactory
|
364 | 365 | .getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
365 |
| - trustManagerFactory.init(KeyStore.getInstance(KeyStore.getDefaultType())); |
| 366 | + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); |
| 367 | + keyStore.load(null); |
| 368 | + trustManagerFactory.init(keyStore); |
366 | 369 |
|
367 | 370 | return new GrpcSslConfigurer(properties.getSsl(), bundles);
|
368 | 371 | }
|
|
0 commit comments