-
Notifications
You must be signed in to change notification settings - Fork 1
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
Server selects certificate based on client's support #17
Comments
This is demonstrated here: https://node-security.com/posts/tls-server-signature-algorithm/#dual-certificates |
Should this be a part of the #1 Epic? We don't need this until we want to serve a web-page so it's far from critical for now. |
Leaving some notes here as I have found that Rust's boring crate doesn't appears to support this. Node's own TLS does support this. The relevant API looks like this:
This is how we combine them:
On the rust code, I'm going to only select the first one. All the other ones we will ignore for now, as it is not possible until boring package itself starts supporting perhaps the Some example C code: #include <openssl/ssl.h>
int select_certificate(SSL *ssl, int *ad, void *arg) {
/* Here, arg should be a structure containing your certificates */
MyCertStorage *storage = (MyCertStorage *)arg;
const char *suitename = SSL_CIPHER_get_name(SSL_get_current_cipher(ssl));
if (strstr(suitename, "ECDSA")) {
SSL_set1_chain(ssl, storage->ecdsa_chain);
SSL_use_PrivateKey(ssl, storage->ecdsa_private_key);
} else if (strstr(suitename, "RSA")) {
SSL_set1_chain(ssl, storage->rsa_chain);
SSL_use_PrivateKey(ssl, storage->rsa_private_key);
} else {
/* Unsupported suite */
return 0;
}
return 1;
}
int main() {
SSL_CTX *ctx;
OpenSSL_add_all_algorithms();
ERR_load_BIO_strings();
ERR_load_crypto_strings();
SSL_load_error_strings();
if (SSL_library_init() < 0)
return 1;
if ((ctx = SSL_CTX_new(SSLv23_server_method())) == NULL)
return 1;
/* Load your certificates into MyCertStorage structure here */
MyCertStorage storage;
/* Load the RSA and ECDSA keys into storage */
SSL_CTX_set_cert_cb(ctx, select_certificate, &storage);
/* ... */
return 0;
} |
The conversation from #26 (comment) to #26 (comment) shows that while boringssl the C++/C code supports it, and boring-sys crate should be exporting these functions, the
So atm, without patching The only reason to have this would be to allow our QUIC system present multiple different certificates... which isn't really necessary atm. In PK, the only time we want to use something other the Ed25519 cert is for the HTTP status page or perhaps the websocket API if we expect browser integration there. So for now, this will be a close as not planned. But can be a feature we revisit in the future. |
Specification
We need the ability to provide an alternative certificate if the
ed25519
certificate is not supported by the client. We will need this if we want to serve web pages to web browsers.This may be implemented using the following boring SSL config options.
Some other options may be needed. I'll need to look into this more.
Additional context
dgram
module #1Tasks
ed25519
is not supported.The text was updated successfully, but these errors were encountered: