-
Notifications
You must be signed in to change notification settings - Fork 141
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
TLSConfiguration.certificateRequired attribute #413
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
9 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
@dnadoba Can you check it again, I pushed a new changeset. |
@@ -268,6 +268,7 @@ public struct TLSConfiguration { | |||
|
|||
/// Whether to verify remote certificates. | |||
public var certificateVerification: CertificateVerification | |||
public var certificateRequired: Bool = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a doc comment to this explaining what it does and how it interacts with the above?
@swift-server-bot test this please |
I have implemented a new attribute
.certificateRequired
inTLSConfiguration
. When set tofalse
, it makes presence of client certificates optional. If the client certificate is provided, then thecustomVerificationCallback
will be called. By default, the attribute is true, which is the current behaviour (failure without client certificate).From an article referenced below, here is a quote:
"[We] tell it to accept requests with no valid certificate. We need this to handle invalid connections as well (for example to display an error message), otherwise, they would just get a cryptic HTTPS error message from the browser (ERR_BAD_SSL_CLIENT_AUTH_CERT to be precise)"
Reference: https://medium.com/@sevcsik/authentication-using-https-client-certificates-3c9d270e8326