Page MenuHomePhabricator

Append the intermediate chain to the "cert" parameter in Aphlict
ClosedPublic

Authored by alexmv on Jul 4 2017, 4:57 AM.
Tags
None
Referenced Files
F14003828: D18181.diff
Sat, Oct 26, 11:19 AM
Unknown Object (File)
Oct 9 2024, 7:31 AM
Unknown Object (File)
Oct 2 2024, 12:31 AM
Unknown Object (File)
Sep 6 2024, 12:41 AM
Unknown Object (File)
Sep 3 2024, 1:36 PM
Unknown Object (File)
Sep 2 2024, 3:27 PM
Unknown Object (File)
Sep 1 2024, 6:57 AM
Unknown Object (File)
Aug 26 2024, 10:41 PM
Subscribers

Details

Summary

Per the documentation[1], any intermediate chain is to be
appended to the "cert" parameter. The "ca" parameter controls the
root CA used to authenticate the client certificate, if one is
provided, and is not used for intermediate certificate chains -- nor
has it ever been. It is not clear how this could have worked in the
past[2].

[1] https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
[2] D15709

Test Plan

Before this diff, with node 4.2.6 from Ubuntu packages:

$ openssl s_client -connect phabricator.dropboxer.net:22280 -verify 5 -CApath /etc/ssl/certs/
verify depth is 5
CONNECTED(00000003)
depth=0 C = US, ST = California, L = San Francisco, O = "Dropbox, Inc", OU = Dropbox Ops, CN = phabricator.dropboxer.net
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = US, ST = California, L = San Francisco, O = "Dropbox, Inc", OU = Dropbox Ops, CN = phabricator.dropboxer.net
verify error:num=27:certificate not trusted
verify return:1
depth=0 C = US, ST = California, L = San Francisco, O = "Dropbox, Inc", OU = Dropbox Ops, CN = phabricator.dropboxer.net
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/C=US/ST=California/L=San Francisco/O=Dropbox, Inc/OU=Dropbox Ops/CN=phabricator.dropboxer.net
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA

After:

$ openssl s_client -connect phabricator.dropboxer.net:22280 -verify 5 -CApath /etc/ssl/certs/
verify depth is 5
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert High Assurance EV Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA
verify return:1
depth=0 C = US, ST = California, L = San Francisco, O = "Dropbox, Inc", OU = Dropbox Ops, CN = phabricator.dropboxer.net
verify return:1
---
Certificate chain
 0 s:/C=US/ST=California/L=San Francisco/O=Dropbox, Inc/OU=Dropbox Ops/CN=phabricator.dropboxer.net
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
 1 s:/C=US/ST=California/L=San Francisco/O=Dropbox, Inc/OU=Dropbox Ops/CN=phabricator.dropboxer.net
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
 2 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA

Diff Detail

Repository
rP Phabricator
Branch
up-aphlict-ssl (branched from master)
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17625
Build 23660: Run Core Tests
Build 23659: arc lint + arc unit

Event Timeline

(Does this survive a cert file with no terminal newline?)

This revision is now accepted and ready to land.Jun 26 2018, 2:58 PM

(Does this survive a cert file with no terminal newline?)

Quick testing says no, and adding an extra newline works fine. Thanks for the catch -- I'll land with that adjustment.