Skip to content

RATIS-1541. Add SslContext to netty ChannelPipeline.#615

Merged
lokeshj1703 merged 2 commits intoapache:masterfrom
szetszwo:RATIS-1541
Mar 8, 2022
Merged

RATIS-1541. Add SslContext to netty ChannelPipeline.#615
lokeshj1703 merged 2 commits intoapache:masterfrom
szetszwo:RATIS-1541

Conversation

@szetszwo
Copy link
Contributor

@szetszwo szetszwo commented Mar 2, 2022

@szetszwo
Copy link
Contributor Author

szetszwo commented Mar 4, 2022

Tested similar changes in https://issues.apache.org/jira/browse/RATIS-1546. It worked fine. I will if we can add some unit tests in https://issues.apache.org/jira/browse/RATIS-1542 .

Copy link
Member

@captainzmc captainzmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the PR. LGTM overall, just two minor comment.

@@ -98,26 +97,25 @@ public GrpcTlsConfig(PrivateKey privateKey, X509Certificate certChain,

public GrpcTlsConfig(File privateKeyFile, File certChainFile,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not used anywhere, can we delete it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captainzmc , thanks for reviewing this. This method is used in Ozone.

@@ -38,7 +38,6 @@
import org.apache.ratis.protocol.exceptions.LeaderNotReadyException;
import org.apache.ratis.protocol.exceptions.TimeoutIOException;
import org.apache.ratis.thirdparty.io.grpc.netty.GrpcSslContexts;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can also be moved below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's sort the imports.

Copy link
Member

@captainzmc captainzmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Thanks @szetszwo update this.

Copy link
Contributor

@lokeshj1703 lokeshj1703 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@szetszwo Thanks for working on this! The changes look good to me. +1.

Comment on lines +73 to +75
b.keyManager(certificates.getFile(), privateKey.getFile());
} else {
b.keyManager(privateKey.get(), certificates.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to PR. It would be better to have same order of private key and certificates in the constructors for SslContextBuilder.

@lokeshj1703 lokeshj1703 merged commit f163cd3 into apache:master Mar 8, 2022
@lokeshj1703
Copy link
Contributor

@szetszwo Thanks for the contribution! I have committed the PR to master branch.

@szetszwo
Copy link
Contributor Author

szetszwo commented Mar 8, 2022

@lokeshj1703 , thanks for reviewing and merging this!

symious pushed a commit to symious/ratis that referenced this pull request Feb 29, 2024
@szetszwo szetszwo deleted the RATIS-1541 branch May 26, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants