Repository navigation
net.mbedtls: Server Name Indication (SNI) - #22012
Conversation
Imported functions needed to use SNI
Allow for a get_certificate callback in SSLConnectConfig. If set, the callback will use SNI to make the callback select the certificate to use for the connection.
SSL Server example using the SNI extension
Updated function description
|
The example |
Yes it should. But be aware that the browser does not send any host name if a domain is not used. So 127.0.0.1 will not work. It can be tested using fx: or |
updated sni callback and new example code.
|
I have updated the code. |
* master: flag: add optional value description to string parameters (#22024) fmt: fix alignment of struct init fields (#22025) cgen: fix selector with interface var (#22006) checker: add a deprecation warning for `const ()` groups (an error after 2025-01-01) (#22019) v2: fix a notice for `v cmd/v2/v2.v` tools: reduce number of os/fs calls done by `v where`; ignore tests/ folders tools: make `v where` ignore .git/ folders (they contain binary files); let `-dir .` work recursively, so that `-dir vlib` works fmt: cleanup fields alignment (#22018) veb: change example description, to avoid repetitive wording (ease debugging of issue#22017) all: allow multi return as fn argument (#21991) examples: change // to blank line in 2048.v too, after 793b66d all: change single blank comment to blank line (#22016) scanner: guard against scanner panic, discovered by fuzzing in PR#22016 time: `d`,`c`,`dd`,`ddd`,`dddd` pattern support for parse_format() (#22003) ast, parser, fmt: cleanup fmt of struct fields with empty line (#22014) ast, parser, fmt: fix fmt of enum fields with empty line (#22015)
|
These new public APIs will need doc comments too, so that the CI can pass: |
|
I've added some comments in 894350f . They may need to be edited later, but should be enough for the CI for now. |
net.mbedtls: Makes it possible to use Server Name Indication (SNI). The mbedtls.SSLConnectConfig is extended with a callback get_certificate which on connection receives a hostname and can return the certificate which the connection should use.
Server Name Indication (SNI) is an extension which is designes to enable usage of multiple domains be the same server on the same port. This extension is used be fx Nginx and Caddy.
Server Name Indication (SNI) is defined in RFC 6066. See https://mbed-tls.readthedocs.io/en/latest/kb/how-to/use-sni/
Example: