SSL handshake failure using serverssl (F5 and Citrix Netscaler)

Hello F5 Experts,

I am getting fatal ssl handshake failure(40) right after the server hello message from the Citrix Netscaler which sits and the vendor location. I can see in wireshark that the TLS protocol & ciphers between the F5 and Netscaler are matching so not sure what else it could be. The serverssl profile is failing and the party on the other side has Citrix netscaler. We have F5 LTM at our end.Also, the citrix netscaler presents a wildcard cert to us as part of SSL termination. Could that be a problem for the F5?

Below are few logs from the ssldump output:

New TCP connection 7: 10.104.41.138(56218) <-> 10.104.40.136(443)
7 1  1529673027.5089 (0.0001)  C>SV3.1(121)  Handshake
      ClientHello
        Version 3.3 
        random[32]=
          46 f9 98 03 10 6c 14 84 4f 11 4e 81 f0 a0 92 dd 
          15 07 84 70 8c c4 94 c4 4d 2c ee 76 df d3 34 32 
        cipher suites
        Unknown value 0xc02f
        Unknown value 0xc030
        Unknown value 0x9c
        Unknown value 0x9d
        Unknown value 0xc027
        Unknown value 0xc028
        Unknown value 0xc013
        Unknown value 0xc014
        TLS_RSA_WITH_AES_128_CBC_SHA256
        TLS_RSA_WITH_AES_256_CBC_SHA256
        TLS_RSA_WITH_AES_128_CBC_SHA
        TLS_RSA_WITH_AES_256_CBC_SHA
        Unknown value 0xc012
        TLS_RSA_WITH_3DES_EDE_CBC_SHA
        Unknown value 0xff
        compression methods
                  NULL
3 2  1529673027.5333 (0.0299)  S>CV3.3(74)  Handshake
      ServerHello
        Version 3.3 
        random[32]=
          5b 2c f5 46 8d 5d 9a 7e 02 10 6e 1c 90 3f d6 02 
          cb 4c be 17 cb 7c 0c 1f 55 c8 77 fc bd 85 21 88 
        session_id[32]=
          73 0d 48 68 8d da 73 e5 77 07 3a dc 47 a2 51 40 
          88 32 a2 3e d6 5c 3a 6b 4e dc c8 2c 28 d2 3c 27 
        cipherSuite         TLS_RSA_WITH_AES_256_CBC_SHA
        compressionMethod                   NULL
3 3  1529673027.5333 (0.0000)  C>SV3.3(2)  Alert
    level           fatal
    value           handshake_failure
2    1529673027.5333 (0.0306)  S>C  TCP RST
3    1529673027.5334 (0.0000)  C>S  TCP RST

Please advise. Any help with this would be really appreciated.

Thank you!

Can you provide the VIP Configuration?

Are you using the default serverssl profile, do you have a monitor to the pool member and is it working? Have you seen myF5 and have you checked the logs for more detailed information?

N

SSL profile config may also help. Wildcard should be fine. If you’re on a version prior to 11.4, the length of the wildcard cert chain could present a problem if it exceeds 32k.

 

 

There could be another requirement on either side that is not being met. HSTS or master secret extensions could also play factors.

 

 

The cert should be negotiated at the time of failure as seen in: DevCentral - An F5 Technical Community

 

The cert exchange should happen next and contain it’s own cert and possibly an intermediary CA. They should be using a standard trusted root CA but if they’re not, you’ll want to have their cert chain in our system to validate.

 

 

But if you can, provide your SSL profile config and the Netscalars and as Anesh stated, your VIP config. That will help determine where the handshake failure may reside.

 

If you can provide the contents of their cert (cert NOT key) and chain, that would be easy to identify if it’s a one-off or weird multi-chain cert.

 

Is this for monitor traffic or real traffic on a pool that is up?

Hello All,

@Anesh - I will provide the configuration by tomorrow however I would like to tell you that there is nothing extraordinary in the configuration. Client & server ssl profiles have been applied to the VIP.

@Nathan - Nope, I have not applied the default ssl profile. Monitor has been applied & it is working correctly. I have reviewed the logs at warning level & hence it does not show me anything specific to the failure reason.

@Abbott - I will provide the SSL config tomorrow. The F5 is running on 11.6.2 so the first link is not releavent for my scenario.

Second link again not for my case reason being proxy SSL is disabled & my version of code is lower.

Third link has some useful information but my serverssl profile is configured correctly with the cert,key & chain parameters. However in the wireshark capture or SSL dump above I receive the fatal error right after the Server Hello & the destination server presents its certificate post the fatal error. The certificate is from a trusted root CA(Comodo).

I really appreciate the inputs provided by you all. Please continue to provide your thoughts. I will also continue to deep dive into this issue.

Regards,

Ajit

Hello Anesh / Chase,

Below is the serverssl profile config:

ltm profile server-ssl abc_443_NP_SLG_https_profile_server-ssl {
    alert-timeout 10
    app-service none
    authenticate once
    authenticate-depth 9
    authenticate-name none
    ca-file Comodo_xyz.crt
    cache-size 262144
    cache-timeout 3600
    cert abc.crt
    chain Entrust-EV-256-Bundle-AVX.crt
    ciphers !SSLv2:!SSLv3:!DTLSv1:!EXP:!MD5:!ADH:!NULL:!LOW:!RC4:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-CBC-SHA:ECDHE-RSA-AES256-CBC-SHA:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:DES-CBC3-SHA:+TLSv1_1:+TLSv1
    crl-file none
    defaults-from serverssl
    description none
    expire-cert-response-control drop
    generic-alert enabled
    handshake-timeout 10
    key abc.key
    mod-ssl-methods disabled
    mode enabled
    options { dont-insert-empty-fragments }
    partition Common
    passphrase "****"
    peer-cert-mode require
    proxy-ssl disabled
    proxy-ssl-passthrough disabled
    renegotiate-period indefinite
    renegotiate-size indefinite
    renegotiation enabled
    retain-certificate true
    secure-renegotiation require![Image Text](/Portals/0/Users/164/20/128420/SSLFailure.PNG?ver=2018-06-25-001012-333)-strict
    server-name none
    session-mirroring disabled
    session-ticket disabled
    sni-default false
    sni-require false
    ssl-forward-proxy disabled
    ssl-forward-proxy-bypass disabled
    ssl-sign-hash any
    strict-resume disabled
    unclean-shutdown enabled
    untrusted-cert-response-control drop
}

Also, I am attaching a wireshark screenshot of the capture where the SSL handshake fails.

can you change Secure Negotiation to Request and test

I see you have a Comodo certificate in the serverssl, does that mean the netscaler is expected the bigip to send a certificate? This is similar to client authentication and you would only have a cert/key here if the other end needed the bigip to send a certificate to authenticate itself against the backend. Normally this is not required.

For a test have you tried the default serverssl profile?

@Anesh - I will surely test the connectivity with secure negotiation set to request tomorrow.

@Nathan - I have enabled server auth in my serverssl which means that the netscaler will present a cert to me & I will validate that cert with the comodo intermediate & root bundle.

Also, client auth is enabled at the netscaler end & hence i am present the abc certs to the netscaler.

Regards,

Ajit

Did you test the change?

Hello Anesh,

Your answer is correct. After making the requested changes the issue got resolved. Thanks for your help! :slightly_smiling_face:

I want to highlight few points with which it was confirmed that this is an HSTS issue:

1) Warning message in the LB logs as below:

18:40:24 LBNAME warning tmm1[23850]: 01260017:4: Connection attempt to insecure SSL server (see RFC5746) aborted: 10.104.40.136:443
2) Openssl command which clearly indicates the problem:

`New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 1024 bit
-->> Secure Renegotiation IS NOT supported <<--
Compression: NONE
Expansion: NONE


Also, the same problem has been highlighted in K13860
Regards,
Ajit

Hello Anesh,

Your answer is correct. After making the requested changes the issue got resolved. Thanks for your help! :slightly_smiling_face:

I want to highlight few points with which it was confirmed that this is an HSTS issue:

1) Warning message in the LB logs as below:

18:40:24 LBNAME warning tmm1[23850]: 01260017:4: Connection attempt to insecure SSL server (see RFC5746) aborted: 10.104.40.136:443

2) Openssl command which clearly indicates the problem:

New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 1024 bit
-->> Secure Renegotiation IS NOT supported <<--
Compression: NONE
Expansion: NONE

Also, the same problem has been highlighted in K13860

Regards,

Ajit

Can you mark my answer as accepted answer.

Hello Anesh,

Please can you post your answer in the answer section? In the comment section I cannot mark it as an answer.

Regards,

Ajit

In your ServerSSL profile, can you try updating Secure Renegotiation from Require Strict to Request

which openssl command are you referring to?

The basic openssl s_client ?