[ 
https://issues.apache.org/jira/browse/CASSANDRA-12903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15663906#comment-15663906
 ] 

Paulo Motta commented on CASSANDRA-12903:
-----------------------------------------

Attaching patch that get rid of shuttting down socket input/output on 
{{ConnectionHandler}}. This was a premature optimization not required for 
correctness, and I don't think it's worth it to keep it only for non-ssl to 
keep the code simple.

Added [simple bootstrap dtest with 
ssl|https://github.com/pauloricardomg/cassandra-dtest/blob/8a16cc21e1d2bfc2c3f534b7f572e732b51c6b94/bootstrap_test.py#L119],
 and verified that is fixed after this patch. Created cassandra-dtest [pull 
request|https://github.com/riptano/cassandra-dtest/pull/1383].

Patch and test results available below:
||3.10||trunk||dtest||
|[branch|https://github.com/apache/cassandra/compare/cassandra-3.X...pauloricardomg:3.10-12903]|[branch|https://github.com/apache/cassandra/compare/trunk...pauloricardomg:trunk-12903]|[branch|https://github.com/riptano/cassandra-dtest/compare/master...pauloricardomg:12903]|
|[testall|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.10-12903-testall/lastCompletedBuild/testReport/]|[testall|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-trunk-12903-testall/lastCompletedBuild/testReport/]|
|[dtest|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.10-12903-dtest/lastCompletedBuild/testReport/]|[dtest|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-trunk-12903-dtest/lastCompletedBuild/testReport/]|


> internode_encryption + bootstrapping a node fails due to calling an 
> unsupported method on an SSL Socket
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-12903
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12903
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Streaming and Messaging
>            Reporter: Eduard Tudenhoefner
>            Assignee: Paulo Motta
>            Priority: Blocker
>             Fix For: 3.10
>
>
> The problem is that you can't call *shutdownInput() / shutdownOutput()* on an 
> *SSLSocket* because it doesn't comply with the TLS protocol
> This got introduced by https://issues.apache.org/jira/browse/CASSANDRA-11841
> {code}
> INFO  [RequestResponseStage-1] 2016-11-11 11:27:06,352  Gossiper.java:1019 - 
> InetAddress /10.200.182.127 is now UP
> INFO  [STREAM-INIT-/10.200.182.127:33555] 2016-11-11 11:27:42,799  
> StreamResultFuture.java:116 - [Stream #dbd51f70-a801-11e6-8ca0-ab33b3e846c9 
> ID#0] Creating new streaming plan for Bootstrap
> ERROR [STREAM-INIT-/10.200.182.127:33555] 2016-11-11 11:27:42,845  
> IncomingStreamingConnection.java:80 - Error while reading from socket from 
> /10.200.182.127:33555.
> java.lang.UnsupportedOperationException: The method shutdownInput() is not 
> supported in SSLSocket
>         at 
> sun.security.ssl.BaseSSLSocketImpl.shutdownInput(BaseSSLSocketImpl.java:215) 
> ~[na:1.8.0_40]
>         at 
> org.apache.cassandra.streaming.ConnectionHandler.initiateOnReceivingSide(ConnectionHandler.java:109)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.StreamResultFuture.attachConnection(StreamResultFuture.java:138)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.StreamResultFuture.initReceivingSide(StreamResultFuture.java:122)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.net.IncomingStreamingConnection.run(IncomingStreamingConnection.java:76)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
> ERROR [STREAM-OUT-/10.200.182.127:33555] 2016-11-11 11:27:42,857  
> StreamSession.java:593 - [Stream #dbd51f70-a801-11e6-8ca0-ab33b3e846c9] 
> Streaming error occurred on session with peer 10.200.182.127
> java.net.SocketException: Socket is closed
>         at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1520) 
> ~[na:1.8.0_40]
>         at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1541) 
> ~[na:1.8.0_40]
>         at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:71) 
> ~[na:1.8.0_40]
>         at 
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) 
> ~[na:1.8.0_40]
>         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) 
> ~[na:1.8.0_40]
>         at 
> org.apache.cassandra.io.util.WrappedDataOutputStreamPlus.flush(WrappedDataOutputStreamPlus.java:66)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:418)
>  [cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:389)
>  [cassandra-all-3.10.1433.jar:3.10.1433]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
> INFO  [STREAM-OUT-/10.200.182.127:33555] 2016-11-11 11:27:42,858  
> StreamResultFuture.java:187 - [Stream #dbd51f70-a801-11e6-8ca0-ab33b3e846c9] 
> Session with /10.200.182.127 is complete
> WARN  [STREAM-OUT-/10.200.182.127:33555] 2016-11-11 11:27:42,863  
> StreamResultFuture.java:214 - [Stream #dbd51f70-a801-11e6-8ca0-ab33b3e846c9] 
> Stream failed
> ERROR [STREAM-OUT-/10.200.182.127:33555] 2016-11-11 11:27:42,864  
> StreamSession.java:593 - [Stream #dbd51f70-a801-11e6-8ca0-ab33b3e846c9] 
> Streaming error occurred on session with peer 10.200.182.127
> java.net.SocketException: Socket is closed
>         at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1520) 
> ~[na:1.8.0_40]
>         at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1541) 
> ~[na:1.8.0_40]
>         at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:71) 
> ~[na:1.8.0_40]
>         at 
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) 
> ~[na:1.8.0_40]
>         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) 
> ~[na:1.8.0_40]
>         at 
> org.apache.cassandra.io.util.WrappedDataOutputStreamPlus.flush(WrappedDataOutputStreamPlus.java:66)
>  ~[cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:418)
>  [cassandra-all-3.10.1433.jar:3.10.1433]
>         at 
> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:397)
>  [cassandra-all-3.10.1433.jar:3.10.1433]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to