Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS 1.3 interoperability failure with servers that request (optional) client certs. #294

Closed
vdukhovni opened this issue Nov 2, 2018 · 13 comments

Comments

@vdukhovni
Copy link
Collaborator

If I enable TLS13, the handshake with the remote server fails with an "Internal Error" alert from the hs-tls client. OpenSSL's TLS 1.3 interoperates with the server. When I enable SSL state logging in OpenSSL I see:

posttls-finger: SSL_connect:before SSL initialization
posttls-finger: SSL_connect:SSLv3/TLS write client hello
posttls-finger: SSL_connect:SSLv3/TLS write client hello
posttls-finger: SSL_connect:SSLv3/TLS read server hello
posttls-finger: SSL_connect:SSLv3/TLS write change cipher spec
posttls-finger: SSL_connect:SSLv3/TLS write client hello
posttls-finger: SSL_connect:SSLv3/TLS write client hello
posttls-finger: SSL_connect:SSLv3/TLS read server hello
posttls-finger: SSL_connect:TLSv1.3 read encrypted extensions
posttls-finger: SSL_connect:SSLv3/TLS read server certificate request
posttls-finger: SSL_connect:SSLv3/TLS read server certificate
posttls-finger: SSL_connect:TLSv1.3 read server certificate verify
posttls-finger: SSL_connect:SSLv3/TLS read finished
posttls-finger: SSL_connect:SSLv3/TLS write client certificate
posttls-finger: SSL_connect:SSLv3/TLS write finished
posttls-finger: Verified TLS connection established to <name[ip]:port>: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
posttls-finger: SSL_connect:SSL negotiation finished successfully
posttls-finger: SSL_connect:SSL negotiation finished successfully
posttls-finger: SSL_connect:SSLv3/TLS read server session ticket
posttls-finger: SSL_connect:SSL negotiation finished successfully
posttls-finger: SSL_connect:SSL negotiation finished successfully
posttls-finger: SSL_connect:SSLv3/TLS read server session ticket

The server solicits (but does not require) a client certificate, and "posttls-finger" sends an empty client certificate message (no client-side certificate is configured).

To make sure I'm on the right track, I've configured my own SMTP server to request certificates on port 587, but not port 25. With that done, the handshake from a client using hs-tls with TLS 1.3 enabled fails to port 587, but succeeds to port 25. Both succeed if I disable TLS 1.3.

So it looks like client certificate requests are not handled correctly with TLS 1.3, but work with earlier TLS versions.

@ocheron
Copy link
Contributor

ocheron commented Nov 2, 2018

At this point client authentication is not implemented at all for TLS13.

@vdukhovni
Copy link
Collaborator Author

@ocheron At this point client authentication is not implemented at all for TLS13.

You may have missed my point. I don't expect to use client authentication. The server asks for optional client certificates, and my client has none so (TLS ≤ 1.2) it successfully continues without them by sending an empty client certificate list. This must continue to work with TLS 1.3. Many (SMTP at least) servers solicit client certificates, but don't require them, clients that have them may get relay access, or be exempt from some anti-spam filters, but authenticated clients are still accepted.

Enabling TLS 1.3 breaks unauthenticated connections to servers that solicit (optional) client certificates.

@ocheron
Copy link
Contributor

ocheron commented Nov 2, 2018

Enabling TLS13 is not supported, the implementation is not finished.

@vdukhovni
Copy link
Collaborator Author

Yes, I understand that it is not finished, I am just testing it lightly, and highlighting places where it does not quite work right yet. I hope that's useful. If not, I can postpone all testing till later...

@kazu-yamamoto
Copy link
Collaborator

Three major issues for TLS 1.3 remain as described in #282.

  • Key update is PRed.
  • Downgrade protection is implemented and waiting for the PR above.
  • I'm working on client authentication now.

@vdukhovni
Copy link
Collaborator Author

I also started work on client auth, how far along are you? Perhaps I should stop...

@vdukhovni
Copy link
Collaborator Author

I have it working for the case with no client certificate (server asks, client declines).

I have almost all the code for the case that the client has a certificate, but it does not handle the server's signatureAlgorithms extension correctly yet (just ignores it, and hardcodes a choice), and is not yet tested. It does however compile (type checks) and is quite close to complete.

@vdukhovni
Copy link
Collaborator Author

I am polishing up the code now, and adding more detailed comments.

@ocheron
Copy link
Contributor

ocheron commented Nov 4, 2018

@vdukhovni Your help is welcome to review the implementation. I have same concern about preserving working functionality that's why I try to see how to expand test coverage.

Currently we have some corner cases due to delayed handshake termination as well as the ticket mechanism. I opened #296 to get better understanding and #297 to give an example of what is wrong.

@kazu-yamamoto
Copy link
Collaborator

@vdukhovni No problem. Please send us a PR for client authentication.

@vdukhovni
Copy link
Collaborator Author

vdukhovni commented Nov 5, 2018

Kazu, are you reachable by Skype or Google Hangouts? Please drop me an email with contact info if you are...

@kazu-yamamoto
Copy link
Collaborator

I sent you my gmail address.

@vdukhovni
Copy link
Collaborator Author

Opened #298 closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants