File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/main/java/com/park/utmstack/config Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 326326 <dependency >
327327 <groupId >com.utmstack.grpc.jclient</groupId >
328328 <artifactId >collector-client-4j</artifactId >
329- <version >1.2.5 </version >
329+ <version >2.0.1 </version >
330330 </dependency >
331331
332332 <!-- WebSocket dependency -->
Original file line number Diff line number Diff line change 22
33import com .park .utmstack .security .GrpcInterceptor ;
44import io .grpc .ManagedChannel ;
5- import io .grpc .ManagedChannelBuilder ;
5+ import io .grpc .netty .GrpcSslContexts ;
6+ import io .grpc .netty .NettyChannelBuilder ;
7+ import io .netty .handler .ssl .util .InsecureTrustManagerFactory ;
68import org .springframework .beans .factory .annotation .Value ;
79import org .springframework .context .annotation .Bean ;
810import org .springframework .context .annotation .Configuration ;
911
1012import javax .annotation .PreDestroy ;
13+ import javax .net .ssl .SSLException ;
1114
1215@ Configuration
1316public class GrpcConfiguration {
@@ -20,11 +23,10 @@ public class GrpcConfiguration {
2023 private Integer serverPort ;
2124
2225 @ Bean
23- public ManagedChannel managedChannel () {
24- this .channel = ManagedChannelBuilder .forAddress (serverAddress , serverPort )
26+ public ManagedChannel managedChannel () throws SSLException {
27+ this .channel = NettyChannelBuilder .forAddress (serverAddress , serverPort )
2528 .intercept (new GrpcInterceptor ())
26- .usePlaintext ()
27- .enableRetry ()
29+ .sslContext (GrpcSslContexts .forClient ().trustManager (InsecureTrustManagerFactory .INSTANCE ).build ())
2830 .build ();
2931 return this .channel ;
3032 }
You can’t perform that action at this time.
0 commit comments