Class SimpleSslContextBuilder
java.lang.Object
io.temporal.serviceclient.SimpleSslContextBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classException that is thrown in case if builder was unable to derive default system trust manager. -
Method Summary
Modifier and TypeMethodDescriptionio.grpc.netty.shaded.io.netty.handler.ssl.SslContextbuild()ConfiguresSslContextfrom the Builder parameters and for use with Temporal GRPC server.io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilderconfigure(io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder sslContextBuilder) Configures specifiedSslContextBuilderfrom the Builder parameters and for use with Temporal GRPC server.static SimpleSslContextBuilderforPKCS12(InputStream pfxKeyArchive) static SimpleSslContextBuilderforPKCS8(InputStream keyCertChain, InputStream key) static SimpleSslContextBuildernewBuilder(InputStream keyCertChain, InputStream key) Deprecated.static SimpleSslContextBuilderExplicitly creates a builder without a client private key or certificate chain.setKeyPassword(String keyPassword) setTrustManager(TrustManager trustManager) setUseInsecureTrustManager(boolean useInsecureTrustManager)
-
Method Details
-
newBuilder
@Deprecated public static SimpleSslContextBuilder newBuilder(InputStream keyCertChain, InputStream key) Deprecated.useforPKCS8(InputStream, InputStream)instead- Parameters:
keyCertChain- - an input stream for an X.509 client certificate chain in PEM format.key- - an input stream for a PKCS#8 client private key in PEM format.
-
noKeyOrCertChain
Explicitly creates a builder without a client private key or certificate chain.forPKCS8(java.io.InputStream, java.io.InputStream)andforPKCS12(java.io.InputStream)support null inputs too for easier configuration API -
forPKCS8
public static SimpleSslContextBuilder forPKCS8(@Nullable InputStream keyCertChain, @Nullable InputStream key) - Parameters:
keyCertChain- - an input stream for an X.509 client certificate chain in PEM format.key- - an input stream for a PKCS#8 client private key in PEM format.
-
forPKCS12
- Parameters:
pfxKeyArchive- - an input stream for .pfx or .p12 PKCS12 archive file
-
configure
public io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder configure(io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder sslContextBuilder) throws SSLException Configures specifiedSslContextBuilderfrom the Builder parameters and for use with Temporal GRPC server.SslContextbuilt by the configured builder can be used withServiceStubsOptions.Builder.setSslContext(SslContext)If trust manager is set then it will be used to verify server authority, otherwise system default trust manager (or if
useInsecureTrustManageris set then insecure trust manager) is going to be used.- Returns:
sslContextBuilder- Throws:
SSLException- when it was unable to build the context
-
build
ConfiguresSslContextfrom the Builder parameters and for use with Temporal GRPC server.If trust manager is set then it will be used to verify server authority, otherwise system default trust manager (or if
useInsecureTrustManageris set then insecure trust manager) is going to be used.- Returns:
SslContextthat can be used with theServiceStubsOptions.Builder.setSslContext(SslContext)- Throws:
SSLException- when it was unable to build the context
-
setTrustManager
- Parameters:
trustManager- - custom trust manager that should be used with the SSLContext for verifying server CA authority.- Returns:
- builder instance.
-
setUseInsecureTrustManager
- Parameters:
useInsecureTrustManager- - if set to true then insecure trust manager is going to be used instead of the system default one. Note that this makes client vulnerable to man in the middle attack. Use with caution.- Returns:
- builder instance.
-
setKeyPassword
- Parameters:
keyPassword- - the password of the key, or null if it's not password-protected.- Returns:
- builder instance.
-
forPKCS8(InputStream, InputStream)instead