zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...
Date Fri, 28 Sep 2018 00:03:24 GMT
Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/184#discussion_r220755547
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/Leader.java ---
    @@ -225,19 +227,36 @@ public boolean isQuorumSynced(QuorumVerifier qv) {
         
         private final ServerSocket ss;
     
    -    Leader(QuorumPeer self,LeaderZooKeeperServer zk) throws IOException {
    +    Leader(QuorumPeer self,LeaderZooKeeperServer zk) throws IOException, X509Exception
{
             this.self = self;
             this.proposalStats = new BufferStats();
             try {
    -            if (self.getQuorumListenOnAllIPs()) {
    -                ss = new ServerSocket(self.getQuorumAddress().getPort());
    +            if (self.shouldUsePortUnification()) {
    +                if (self.getQuorumListenOnAllIPs()) {
    +                    ss = new UnifiedServerSocket(new QuorumX509Util(), self.getQuorumAddress().getPort());
    +                } else {
    +                    ss = new UnifiedServerSocket(new QuorumX509Util());
    +                }
    +            } else if (self.isSslQuorum()) {
    +                if (self.getQuorumListenOnAllIPs()) {
    +                    ss = new QuorumX509Util().createSSLServerSocket(self.getQuorumAddress().getPort());
    +                } else {
    +                    ss = new QuorumX509Util().createSSLServerSocket();
    +                }
                 } else {
    -                ss = new ServerSocket();
    +                if (self.getQuorumListenOnAllIPs()) {
    +                    ss = new ServerSocket(self.getQuorumAddress().getPort());
    +                } else {
    +                    ss = new ServerSocket();
    +                }
                 }
                 ss.setReuseAddress(true);
                 if (!self.getQuorumListenOnAllIPs()) {
                     ss.bind(self.getQuorumAddress());
                 }
    +        } catch (X509Exception e) {
    +            LOG.error("failed to setup ssl server socket", e);
    --- End diff --
    
    nit: `Failed to` 


---

Mime
View raw message