Skip to content

Commit

Permalink
Test : regenerate SSL certificate for postgresql (#506)
Browse files Browse the repository at this point in the history
Previous certificate didn't contain `postgresql` name in SAN, just
`localhost`:

```
openssl x509 -noout -text -in tests/ssl/postgresql/postgresql.crt

    Data:
        Version: 3 (0x2)
        Serial Number:
            3b:84:c1:a2:8a:44:d9:5f:99:ac:0b:d1:ef:19:af:36:6b:cb:b3:50
...
        Subject: C=GB, ST=London, L=London, O=Global Security, OU=IT, CN=Test leaf certificate
...
            X509v3 Subject Alternative Name:
                DNS:localhost
```

This made impossible to perform mTLS tests when Acra and PostgreSQL
are located on different hosts.

That certificate may be integrated in some pre-built Docker images, so
we intentionally do not revoke it. Here we just remove it from the repository
and regenerated with both `postgresql` and `localhost` names in SAN. So all
newer images will contain this certificate.

Also here we configured 'unique_subject = no' in tests/ssl/ca/index.txt.attr to
make it possible to not revoke previous certificate to regenerate it
with the same name.
  • Loading branch information
shadinua authored Feb 22, 2022
1 parent b229824 commit 58cdd5c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 45 deletions.
1 change: 1 addition & 0 deletions tests/ssl/ca/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ V 701120042524Z 2EF93DB7FC32A5E6978CA5BAE39AD3E3388054FA unknown /C=GB/ST=Londo
V 20710124163231Z 0125566B86FC383387769B8DA78EE58F1EE47728 unknown /C=GB/ST=London/L=London/O=Global Security/OU=IT/CN=Test leaf certificate (vault)
V 20711209225856Z 5E795411F36CFC9DEB0D60EA9C420E3691CEEA39 unknown /C=GB/ST=London/L=London/O=Global Security/OU=IT/CN=Test leaf certificate (acra-client)
V 20711211031324Z 3B84C1A28A44D95F99AC0BD1EF19AF366BCBB34F unknown /C=GB/ST=London/L=London/O=Global Security/OU=IT/CN=Test leaf certificate (mysql)
V 20720210195256Z 09770D64B2AD5F80AC3021F9DAD513E2AD897407 unknown /C=GB/ST=London/L=London/O=Global Security/OU=IT/CN=Test leaf certificate (postgresql)
1 change: 1 addition & 0 deletions tests/ssl/ca/index.txt.attr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unique_subject = no
41 changes: 22 additions & 19 deletions tests/ssl/postgresql/postgresql.crt
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIDqjCCApKgAwIBAgIUO4TBoopE2V+ZrAvR7xmvNmvLs1AwDQYJKoZIhvcNAQEL
MIIEKTCCAxGgAwIBAgIUCXcNZLKtX4CsMCH52tUT4q2JdAcwDQYJKoZIhvcNAQEL
BQAwdDELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwGTG9u
ZG9uMRgwFgYDVQQKDA9HbG9iYWwgU2VjdXJpdHkxCzAJBgNVBAsMAklUMRwwGgYD
VQQDDBNUZXN0IENBIGNlcnRpZmljYXRlMCAXDTIwMDkyMjE2MDUzNFoYDzIwNzAw
OTEwMTYwNTM0WjB2MQswCQYDVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYD
VQQHDAZMb25kb24xGDAWBgNVBAoMD0dsb2JhbCBTZWN1cml0eTELMAkGA1UECwwC
SVQxHjAcBgNVBAMMFVRlc3QgbGVhZiBjZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAMoGQUWd1qneYuo69tUKajmALQ67/hKPpHH2A/N6
8hhpW06UyFdMYNB4FfCHqlqOgA1u8ccszxD6LXOKRJQYW1/9vFZv/4XNco2df2ay
ytSPrkcp+v5kfsJng4Hf8f8sU0MXOqHTxb4GTtMjUTYFmLXHXlpdq+0e9vV8nUH5
51xTYqw97V9W0fXUAKSOlO5WVoPn8i17a3PfHzd0t/t6Tqc9ZK+EIjV813nSYNPA
zpg2vvvu+xoMaH50ht5X3gHxQjjMlkHT6JZnlBDLCZg/VDr9mX5Sk++6FK7ZoEhx
08zDAmuTEYfli1YPmBgsjKc9uyJGIuXIasQbFT87HsT+juUCAwEAAaMwMC4wC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h8pQdbylr542EmH123TIEJRUb9EGOE8manVyYG8tmP9TmBO+R22U
XwIDAQABo4GgMIGdMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMCAGA1UdEQQZMBeC
CWxvY2FsaG9zdIIKcG9zdGdyZXNxbDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUH
MAGGFWh0dHA6Ly8xMjcuMC4wLjE6ODg4ODAuBgNVHR8EJzAlMCOgIaAfhh1odHRw
Oi8vMTI3LjAuMC4xOjg4ODkvY3JsLnBlbTANBgkqhkiG9w0BAQsFAAOCAQEAEUu+
0AJPdZM9jo3MwBCBXHcLHdk9oxUjywi6CklYPXXxPt6syxOV3jRRvVyVIjV4KCFr
9sWtWwxlvnu9lpAMArZJLQ7PEDT3D9Gc2SqoY8Lh0W5M0vOBJlJOzQMAZu75R97y
QeKpgeI4irnY7HeJ6NqJXEYygXYSIP2uYoT6cCsSmKpCH5XHNcUtZhttj1ga5Hlw
RP+w74O4PH1WfsPhZcdi/Y3CODQPCUFHxTqqeVxX6xr7VpMSCK6hKRlsZiqR9wpA
fnEUtd8Jf6YgNWTsSzhKwQWe4UP0ujFpdoBgazPO2+hsf4g1qVvKLpSa4A5sH8H+
W7SvlguoOKsXsPZdhA==
-----END CERTIFICATE-----
52 changes: 26 additions & 26 deletions tests/ssl/postgresql/postgresql.key
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAygZBRZ3Wqd5i6jr21QpqOYAtDrv+Eo+kcfYD83ryGGlbTpTI
V0xg0HgV8IeqWo6ADW7xxyzPEPotc4pElBhbX/28Vm//hc1yjZ1/ZrLK1I+uRyn6
/mR+wmeDgd/x/yxTQxc6odPFvgZO0yNRNgWYtcdeWl2r7R729XydQfnnXFNirD3t
X1bR9dQApI6U7lZWg+fyLXtrc98fN3S3+3pOpz1kr4QiNXzXedJg08DOmDa+++77
GgxofnSG3lfeAfFCOMyWQdPolmeUEMsJm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