Skip to content

Commit

Permalink
finagle: Regenerate expired certificates used in tests
Browse files Browse the repository at this point in the history
Problem

We had 2 expired certificates which were causing tests to fail.

Solution

Regenerate these (good for 5 years), add instructions for regenerating, and remove the KTF from the build file.

JIRA Issues: CSL-12418

Differential Revision: https://phabricator.twitter.biz/D1170786
  • Loading branch information
jcrossley authored and jenkins committed Sep 17, 2024
1 parent aff1568 commit 8b74e72
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 26 deletions.
12 changes: 11 additions & 1 deletion finagle-core/src/test/resources/ssl/README
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
The certificates and keys located in these directories have been generated by Twitter engineers for example purposes and are intended for testing only. They have nothing to do with Twitter production or development systems.
The certificates and keys located in these directories have been generated by X engineers for example purposes and are intended for testing only. They have nothing to do with X production or development systems.

To generate a new certificate, from this (ssl) directory, run:

For test-ec-with-sans.crt:
$ openssl req -new -key keys/test-ec-key.pem -out request.csr -config conf/test-ec-with-sans.cnf
$ openssl x509 -req -days 1825 -in request.csr -signkey keys/test-ec-key.pem --out certs/test-ec-with-sans.crt -extensions v3_ca -extfile conf/test-ec-with-sans.cnf

For test-ecclient-with-sans.crt:
$ openssl req -new -key keys/test-ec-key.pem -out request.csr -config conf/test-ecclient-with-sans.cnf
$ openssl x509 -req -days 1825 -in request.csr -signkey keys/test-ec-key.pem --out certs/test-ecclient-with-sans.crt -extensions v3_ca -extfile conf/test-ecclient-with-sans.cnf
27 changes: 15 additions & 12 deletions finagle-core/src/test/resources/ssl/certs/test-ec-with-sans.crt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICGzCCAcGgAwIBAgIJAO2zMrMg5/CSMAoGCCqGSM49BAMCMGQxCzAJBgNVBAYT
AlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEQMA4GA1UE
CgwHVHdpdHRlcjEeMBwGA1UECwwVQ29yZSBTeXN0ZW0gTGlicmFyaW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bUs6oIAO7knk04zicAiAomS6rW9Uf4nVXaWaRVjL5HbQVhwA4ZJp0
owLQ/3d39Q==
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions finagle-core/src/test/resources/ssl/conf/test-ec-with-sans.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[ req ]
default_bits = 256
default_md = sha256
distinguished_name = req_distinguished_name
req_extensions = req_ext
prompt = no

[ req_distinguished_name ]
C = US
ST = CA
L = San Francisco
O = Twitter
OU = Core System Libraries
CN = Twitter Core System Libraries Certificate

[ req_ext ]
subjectAltName = @alt_names
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = clientAuth

[ alt_names ]
URI.1 = twtr:svc:csl-test:test-ecserver:devel:local

[ v3_ca ]
keyUsage = critical, keyEncipherment, dataEncipherment
extendedKeyUsage = TLS Web Client Authentication
subjectAltName = @alt_names
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[ req ]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[ req_distinguished_name ]
C = US
ST = CA
L = San Francisco
O = Twitter
OU = Core System Libraries
CN = Core System Libraries Client

[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = critical, KeyEncipherment, DataEncipherment
extendedKeyUsage = TLS Web Client Authentication
subjectAltName = @alt_names

[ alt_names ]
URI.1 = twtr:svc:csl-test:test-ecclient:devel:local

[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical, CA:FALSE
subjectAltName = @alt_names
5 changes: 5 additions & 0 deletions finagle-core/src/test/resources/ssl/keys/test-ec-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIAYh4d/7S1NkOYmhLe0EIajAP+pnQ4icN0cqOkfkZjFXoAoGCCqGSM49
AwEHoUQDQgAEBXzK89JoYE1KlVMDfhlxj+4MWtogPayAGtCA0mLWvRiQYLHyWVOF
MBn3FIiXrZBpeWJLnnh8WoSjHDjD+y+86g==
-----END EC PRIVATE KEY-----
1 change: 0 additions & 1 deletion finagle-core/src/test/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ junit_tests(
# env_local is tag for bazel only, added due to DPB-14188
tags = [
"bazel-compatible",
"known-to-fail-jira:CSL-12418",
],
dependencies = [
":pushsession-utils",
Expand Down

0 comments on commit 8b74e72

Please sign in to comment.