-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add serverCertificateHashes test server #50263
base: master
Are you sure you want to change the base?
Conversation
Add a second webtransport server, in order to test connection with a server, that has a self-signed certificate together with serverCertificateHashes. See web-platform-tests/rfcs#216
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.
Took a first pass at this, but looks good overall.
""" | ||
Specify, if the server should generate a certificate or use an existing certificate | ||
USEPREGENERATED: use existing certificate | ||
GENERATEDVALIDSERVERCERTIFICATEHASHCERT: generate a certificate compatible to server cert hashes |
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.
minor nit:
GENERATEDVALIDSERVERCERTIFICATEHASHCERT: generate a certificate compatible to server cert hashes | |
GENERATEDVALIDSERVERCERTIFICATEHASHCERT: generate a certificate compatible with server cert hashes |
""" | ||
USEPREGENERATED = 1, | ||
GENERATEDVALIDSERVERCERTIFICATEHASHCERT = 2 | ||
# TODO add cases for invalid certificates |
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.
# TODO add cases for invalid certificates | |
# TODO(jgraham): add cases for invalid certificates |
@@ -507,18 +521,31 @@ class WebTransportH3Server: | |||
:param host: Host from which to serve. | |||
:param port: Port from which to serve. | |||
:param doc_root: Document root for serving handlers. | |||
:paran cert_mode: The used certificate mode can be |
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.
:paran cert_mode: The used certificate mode can be | |
:param cert_mode: The used certificate mode can be |
@@ -499,6 +503,16 @@ def add(self, ticket: SessionTicket) -> None: | |||
def pop(self, label: bytes) -> Optional[SessionTicket]: | |||
return self.tickets.pop(label, None) | |||
|
|||
class WebTransportCertificateGeneration(Enum): |
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.
If we're assigning them integer values, we can use IntEnum and skip the additional import, right?
class WebTransportCertificateGeneration(Enum): | |
class WebTransportCertificateGeneration(IntEnum): |
USEPREGENERATED: use existing certificate | ||
GENERATEDVALIDSERVERCERTIFICATEHASHCERT: generate a certificate compatible to server cert hashes |
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.
This makes it a little bit more readable:
USEPREGENERATED: use existing certificate | |
GENERATEDVALIDSERVERCERTIFICATEHASHCERT: generate a certificate compatible to server cert hashes | |
USE_PREGENERATED: use existing certificate | |
GENERATE_VALID_SERVER_CERTIFICATE_HASH_CERT: generate a certificate compatible to server cert hashes |
Add a second webtransport server, in order to test connection with a server, that has a self-signed certificate together with serverCertificateHashes.
See web-platform-tests/rfcs#216