FilKarnicki commented on a change in pull request #306:
URL: https://github.com/apache/flink-statefun/pull/306#discussion_r818294287
##########
File path:
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/nettyclient/NettyClient.java
##########
@@ -208,4 +225,77 @@ private void releaseChannel0(Channel channel) {
}
channel.close().addListener(ignored -> pool.release(channel));
}
+
+ private static SslContext getSslContext(NettyRequestReplySpec spec) {
+ Optional<String> maybeTrustCaCerts = spec.getTrustedCaCertsOptional();
+ Optional<String> maybeClientCerts = spec.getClientCertsOptional();
+ Optional<String> maybeClientKey = spec.getClientKeyOptional();
+ Optional<String> maybeKeyPassword = spec.getClientKeyPasswordOptional();
+
+ if (maybeClientCerts.isPresent() && !maybeClientKey.isPresent()) {
+ throw new IllegalStateException(
+ "You provided a client cert, but not a client key. Cannot
continue.");
+ }
+ if (maybeClientKey.isPresent() && !maybeClientCerts.isPresent()) {
Review comment:
My intention was to write a kind of an XOR gate here. No cert/key is
fine, both cert+key is fine, but not when there's one and not the other. Let me
think if I can make this better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]