Skip to content

Commit 2d9ef36

Browse files
authored
Return ref to this in SimpleSslContextBuilder (#322)
* Return ref to this in SimpleSslContextBuilder * make netty-shaded api dependency
1 parent b3797d6 commit 2d9ef36

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

temporal-serviceclient/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ dependencies {
8383
api group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.14.0'
8484
api group: 'com.uber.m3', name: 'tally-core', version: '0.6.1'
8585
api group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
86-
87-
implementation 'io.grpc:grpc-netty-shaded:1.35.0'
86+
api 'io.grpc:grpc-netty-shaded:1.35.0'
8887
if (!JavaVersion.current().isJava8()) {
8988
implementation 'javax.annotation:javax.annotation-api:1.3.2'
9089
}

temporal-serviceclient/src/main/java/io/temporal/serviceclient/SimpleSslContextBuilder.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,31 @@ public SslContext build() throws SSLException {
9494
/**
9595
* @param trustManager - custom trust manager that should be used with the SSLContext for
9696
* verifying server CA authority.
97+
* @return builder instance.
9798
*/
98-
public void setTrustManager(TrustManager trustManager) {
99+
public SimpleSslContextBuilder setTrustManager(TrustManager trustManager) {
99100
this.trustManager = trustManager;
101+
return this;
100102
}
101103

102104
/**
103105
* @param useInsecureTrustManager - if set to true then insecure trust manager is going to be used
104106
* instead of the system default one. Note that this makes client vulnerable to man in the
105107
* middle attack. Use with caution.
108+
* @return builder instance.
106109
*/
107-
public void setUseInsecureTrustManager(boolean useInsecureTrustManager) {
110+
public SimpleSslContextBuilder setUseInsecureTrustManager(boolean useInsecureTrustManager) {
108111
this.useInsecureTrustManager = useInsecureTrustManager;
112+
return this;
109113
}
110114

111-
/** @param keyPassword - the password of the key, or null if it's not password-protected. */
112-
public void setKeyPassword(String keyPassword) {
115+
/**
116+
* @param keyPassword - the password of the key, or null if it's not password-protected.
117+
* @return builder instance.
118+
*/
119+
public SimpleSslContextBuilder setKeyPassword(String keyPassword) {
113120
this.keyPassword = keyPassword;
121+
return this;
114122
}
115123

116124
/**

0 commit comments

Comments
 (0)