You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a continuation of issues 79432 and 77768, as those issues are now locked from further comment.
I have been working with Microsoft support on this failure and they have confirmed what has been previously reported:
The TLS 1.3 handshake fails because the TLS client (in this case Ansible) does not send a post handshake authentication extension in the TLS 1.3 "Client Hello" message. This is visible in the network trace: when the network trace is open with Wireshark and one examines the TLS Client Hello message, it is missing the Extension: post_handshake_auth extension. In general TLS 1.3 authentication can be done either in handshake or post handshake.
I know that Ansible relies on underlying Python libraries, which themselves rely on underlying OpenSSL libraries. However, my research would suggest that both Python and OpenSSL have now been updated to support post handshake authentication and TLS 1.3. This is based on the following:
Is it now the case that the Ansible code needs to be updated to take advantage of the new capability in Python? Or have I misunderstood the current status?
You are correct in your assessment but the implementation is quite difficult. Essentially Python exposes the OpenSSL option SSLContext.post_handshake_auth which can be set to True to allow the post handshake authentication. The difficulty comes with pywinrm or pypsrp actually setting this option for a few reasons. It is only supported on Python 3.8+ (you are on Python 3.6 so can't take advantage of it). The underlying HTTP library requests and while they do support custom transport adapters where this can be set I'm unsure whether it's feasible to do so. For example we still need to use the existing certificate loading logic which some platforms override in their requests package. This coupled with the fact that certificate authentication isn't really that easy to set up and that the keys need to be in plaintext makes it a lower priority in terms of fixes we look at.
IMO you are better off just using basic or NTLM authentication instead of messing with certificates. Using TLS negates the disadvantages of both options (weak to no encryption and no server authentication) and you no longer have to mess with generating certificates and mapping the user with the certificate on each Windows target. Finally you no longer have to maintain the certificate key as a file, you can use tools like ansible-vault to encrypt the password which you cannot do with certificate keys.
In saying all that I do have a working implementation that uses the psrp connection plugin but currently it is in the beta stage. The latest unreleased changes of pypsrp include support for this new option with these lines. Unfortunately it is being held up by a few things right now so isn't available for use in the existing connection plugins. If you wanted to try it out you will need to:
Upgrade to Python 3.8 as the minimum
Install pypsrp from the master branch to include the new TLS changes
@jborean93 thanks for the quick and detailed explanation of the current situation. I am taking these findings to my management, to determine our path forwards.
Summary
This is a continuation of issues 79432 and 77768, as those issues are now locked from further comment.
I have been working with Microsoft support on this failure and they have confirmed what has been previously reported:
The TLS 1.3 handshake fails because the TLS client (in this case Ansible) does not send a post handshake authentication extension in the TLS 1.3 "Client Hello" message. This is visible in the network trace: when the network trace is open with Wireshark and one examines the TLS Client Hello message, it is missing the Extension: post_handshake_auth extension. In general TLS 1.3 authentication can be done either in handshake or post handshake.
I know that Ansible relies on underlying Python libraries, which themselves rely on underlying OpenSSL libraries. However, my research would suggest that both Python and OpenSSL have now been updated to support post handshake authentication and TLS 1.3. This is based on the following:
openssl/openssl#6933
python/cpython#81621
python-trio/trio#741
Is it now the case that the Ansible code needs to be updated to take advantage of the new capability in Python? Or have I misunderstood the current status?
Issue Type
Bug Report
Component Name
apt
Ansible Version
Configuration
OS / Environment
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
Steps to Reproduce
Expected Results
Output from ipconfig should be returned and displayed.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: