title: SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate:s3_pkt.c:1259:SSL alert number 42
body: <p>I've enabled SSL for a distributed database (cassandra), where each of the peers have the same keystore and trustore files. I've imported the Comodo signed certificate into the keystore, and also the intermediate and root certificates provided by Comodo. Into the truststore I've uploaded the root certificate and the intermediates. Below is the output I'm getting when I run a <code>openssl s_client</code>. I'm getting the below mentioned error:</p>
  
  <blockquote>
    <p>139810559764296:error:14094412:SSL routines:SSL3_READ_BYTES:sslv3
    alert bad certificate:s3_pkt.c:1259:SSL alert number 42
    139810559764296:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
    failure:s23_lib.c:184:</p>
  </blockquote>
  
  <p>At the end of the message however I get <code>"Verify return code: 0 (ok)"</code>.</p>
  
  <p>The cluster seems fine and the peers are able to recognize each other though. </p>
  
  <blockquote>
    <p>openssl s_client -host example.xyz -port 10145</p>
    
    <p>CONNECTED(00000003)</p>
    
    <p>depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network,
    CN = AddTrust External CA Root</p>
    
    <p>verify return:1 depth=2 C = GB, ST = Greater Manchester, L = Salford,
    O = COMODO CA Limited, CN = COMODO RSA Certification Authority</p>
    
    <p>verify return:1 depth=1 C = GB, ST = Greater Manchester, L = Salford,
    O = COMODO CA Limited, CN = COMODO RSA Organization Validation Secure
    Server CA</p>
    
    <p>verify return:1 depth=0 C = US, postalCode = *****, ST = **, L =
    *****, street = ****, O = ****, OU = dvrci1, OU = ******, OU = ******, CN = hostname</p>
    
    <p>verify return:1140115008423752:error:14094412:SSL
    routines:SSL3_READ_BYTES:sslv3 alert bad certificate:s3_pkt.c:1259:SSL
    alert number 42 140115008423752:error:140790E5:SSL
    routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184: SSL
    handshake has read 6648 bytes and written 354 bytes New, TLSv1/SSLv3,
    Cipher is AES128-SHA Server public key is 2048 bit Secure
    Renegotiation IS supported Compression: NONE Expansion: NONE
    SSL-Session:<br>
        Protocol  : TLSv1.2<br>
        Cipher    : AES128-SHA<br>
        Session-ID: 57EBD44A5F04D45A44137682F375F1BFE2C45B27182927FC23F7255FC0B37226<br>
        Session-ID-ctx:<br>
        Master-Key:  A771BCAFB4DD8CC3D8C476F9DBA542998EC5CE926ADB4612C433668D515F03C38D519D6CE2434F52
    4273320CF24476FC<br>
        Key-Arg   : None<br>
        Krb5 Principal: None<br>
        PSK identity: None<br>
        PSK identity hint: None<br>
        Start Time: 1475080428<br>
        Timeout   : 300 (sec)<br>
        Verify return code: 0 (ok)  </p>
  </blockquote>