Skip to content
Discussion options

You must be logged in to vote

I tested this locally and can reproduce the same issue.

When connecting without handshake_first, the server logs:

[1] 2026/01/07 09:43:31.164056 [ERR] 192.168.215.1:35352 - cid:5 - TLS handshake error: tls: received record with version 301 when expecting version 303

If you set handshake_first: true in the TLS configuration
(see: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/tls#tls-first-handshake), the connection succeeds and returns a valid certificate.

echo | openssl s_client -connect localhost:4222 2>/dev/null | openssl x509 -noout -enddate

> notAfter=Mar  8 09:34:31 2026 GMT

Even with handshake_first enabled, the NATS server still logs a parser error:

[1] …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jingzhaoyang
Comment options

Answer selected by jingzhaoyang
Comment options

You must be logged in to vote
1 reply
@jingzhaoyang
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants