grpc-go/security/advancedtls/testdata
eshitachandwani cbb5c2f5f9
advancedtls: update CRL provider certificates (#8073)
2025-02-11 14:53:12 +05:30
..
crl advancedtls: update CRL provider certificates (#8073) 2025-02-11 14:53:12 +05:30
README.md .*: Add missing a newline at the end (#7644) 2024-09-18 14:46:09 +05:30
another_client_cert_1.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
another_client_key_1.pem advancedtls: add examples demonstrating reloading behaviors (#4018) 2020-12-04 15:47:27 -08:00
client_cert_1.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
client_cert_2.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
client_key_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
client_key_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
client_trust_cert_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
client_trust_cert_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
client_trust_key_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
client_trust_key_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
localhost-openssl.cnf advancedtls: add IPv6 address to certificate SAN names (#4101) 2020-12-18 11:05:59 -08:00
openssl-ca.cnf *: fix minor typos (#7487) 2024-08-14 22:43:01 +05:30
server_cert_1.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_cert_1.txt vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_cert_2.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_cert_2.txt vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_cert_3.pem advancedtls: Add SNI logic to ServerOptions.GetCertificate (#3697) 2020-07-27 23:50:43 -07:00
server_cert_3.txt vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_cert_localhost_1.pem vet: add check for trailing spaces (#7576) 2024-09-12 11:40:38 +05:30
server_key_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
server_key_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
server_key_3.pem advancedtls: Add SNI logic to ServerOptions.GetCertificate (#3697) 2020-07-27 23:50:43 -07:00
server_key_localhost_1.pem advancedtls: add IPv6 address to certificate SAN names (#4101) 2020-12-18 11:05:59 -08:00
server_trust_cert_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
server_trust_cert_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
server_trust_key_1.pem advancedtls: add new module for advanced TLS handshaker (#3187) 2020-01-07 15:47:01 -08:00
server_trust_key_2.pem advancedtls: add end to end tests (#3318) 2020-01-28 14:24:27 -08:00
testdata.go security: Add a package level comment to testdata package in advancedtls (#3317) 2020-01-14 14:10:59 -08:00

README.md

About This Directory

This testdata directory contains the certificates used in the tests of package advancedtls.

How to Generate Test Certificates Using OpenSSL

Supposing we are going to create a subject_cert.pem that is trusted by ca_cert.pem, here are the commands we run:

  1. Generate the private key, ca_key.pem, and the cert ca_cert.pem, for the CA:

    $ openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -nodes -days $DURATION_DAYS
    
  2. Generate a private key subject_key.pem for the subject:

    $ openssl genrsa -out subject_key.pem 4096
    
  3. Generate a CSR csr.pem using subject_key.pem:

    $ openssl req -new -key subject_key.pem -out csr.pem
    

    For some cases, we might want to add some extra SAN fields in subject_cert.pem. In those cases, we can create a configuration file(for example, localhost-openssl.cnf), and do the following:

    $ openssl req -new -key subject_key.pem -out csr.pem -config $CONFIG_FILE_NAME
    
  4. Use ca_key.pem and ca_cert.pem to sign csr.pem, and get a certificate, subject_cert.pem, for the subject:

    This step requires some additional configuration steps and please check out this answer from StackOverflow for more.

    $ openssl ca -config openssl-ca.cnf -policy signing_policy -extensions signing_req -out subject_cert.pem -in csr.pem -keyfile ca_key.pem -cert ca_cert.pem
    

    Please see an example configuration template at openssl-ca.cnf.

  5. Verify the subject_cert.pem is trusted by ca_cert.pem:

    $ openssl verify -verbose -CAfile ca_cert.pem  subject_cert.pem