Skip to content
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

BUG FIX: SSL module doesn't support chained certificates #204

Closed
daniel-sullivan opened this issue Jan 27, 2016 · 0 comments · Fixed by #250
Closed

BUG FIX: SSL module doesn't support chained certificates #204

daniel-sullivan opened this issue Jan 27, 2016 · 0 comments · Fixed by #250

Comments

@daniel-sullivan
Copy link

Hi All,

I've come up against an issue in one of my deployments which I've traced back to this and provide a fix for below if someone would be so kind as to submit it for me :)

At present, ssl.c loads the user's provided SSL certificate set in HS_SSLCERTFILE using SSL_CTX_use_certificate file:

openssl_use_certificate(openssl_env *env, char *file) {
  if (file)
    if (SSL_CTX_use_certificate_file(env->ctx, file, SSL_FILETYPE_PEM) > 0)
      return 1;
  syslog(LOG_ERR, "%s: could not load certificate file %s\n", strerror(errno), file);
  return 0;

This works fine as is however breaks chained certificate files (including intermediate trusts).

As per https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html , using SSL_CTX_use_certificate_file isn't recommended for this reason (see the NOTES section). There may be a good reason for using _file in which case please disregard this and I'll just go ahead with my deployment but I have attached below a modified version of ssl.c using SSL_CTX_use_certificate_chain_file instead which I have tested working with chained and unchained certificates.

Kind Regards,
Daniel Sullivan
Reticulum IT

ssl.txt

sevan added a commit that referenced this issue May 26, 2016
…ate bundles (#250)

can be used. Patch from @daniel-sullivan, resolves #204

	modified:   src/ssl.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant