Skip to content

Conversation

@wfurt
Copy link
Member

@wfurt wfurt commented Jun 8, 2020

The information is already ready. It is set by ProcessHandshakeSuccess() in CompleteHandshake() prior to calling VerifyRemoteCertificate(). The problem is that _handshakeCompleted is not yet set to true so attempt to access the properties from callback will throw.

I did not want to touch _handshakeCompleted as that would change external behavior and set IsAutneticated prematurely. Instead, I added new helper function to allow access also if ConnectionInfo is available e.g. we progressed far enough in the handshake.

fixes #919

@wfurt wfurt added enhancement Product code improvement that does NOT require public API changes/additions area-System.Net.Security labels Jun 8, 2020
@wfurt wfurt requested a review from a team June 8, 2020 07:29
@wfurt wfurt self-assigned this Jun 8, 2020
@ghost
Copy link

ghost commented Jun 8, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the call sites very hot paths? Wondering if it's really beneficial to force inline it like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try to measure it. For now, I just followed pattern from other helper methods.
Generally I would not expect them on hot path. The properties would either never be used or used once for logging after handshake is completed.

@wfurt wfurt merged commit ecc310b into dotnet:master Jun 9, 2020
@wfurt wfurt deleted the sslInfo_919 branch June 9, 2020 06:56
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net.Security enhancement Product code improvement that does NOT require public API changes/additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SslStream RemoteCertificateValidationCallback cannot access protocol/cipher info

3 participants