Subject: | Certificate in t/SSL_test.t and t/SSLEAY_test.t not playing well with openssl on Debian |
Both of those tests were failing on Debian (10.3) until I replaced the cert and key defined in both t/SSL_test.t and t/SSLEAY_test.t with the contents of the resulting files from
openssl req -x509 -sha256 -nodes -days 9150 -newkey rsa:2048 -keyout test.key -out test.crt
After that both tests passed just fine.
It would seem that the "invalid" certificate is a little too invalid for the tastes of some newer openssl versions.
### contents of test.crt and test.key
my $pem = << 'PEM'; # this certificate is invalid, please only use for testing
Show quoted text
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUX5bOrA7M5R3nOFzxAG/AczyBtHYwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMDAzMjcwMDM0MjhaFw00NTA0
MTUwMDM0MjhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDeMD12F5YXpiHJq2A+So3I8ppaRas5YTJm5My7p41M
ChWhTJATBHVyICFAnw65oj0sl0SFG+eyFyOi7h051RHEAyIWEsmnfeqsTRzglYm1
lc8Fi9T4cgCX9i2/y2c1nzVUAlbPU7j603VCWz0G9G5Mou315SEq7UgcVe92l6o+
/qIJUibX3KjqSAtF4L9SQd7Br5PyrnaKqmg9IBUCDS12LV/I2WghnQywm/3HFwCK
cd1owGDoOpbJSfhXtxlR+NI+uTc5M2BeGGl0+REX1WT02nJHhgYr+JzArW/02VNk
JNDXAn10OkQ7enhvPGUH+zperkayb71ADkQ+7i+HWsr/AgMBAAGjUzBRMB0GA1Ud
DgQWBBQzRw/VaV1pjY+cnR6xKOIPJc61MDAfBgNVHSMEGDAWgBQzRw/VaV1pjY+c
nR6xKOIP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C
UTaFe1oaBoklURf3UYswxNB0OQ215By4QEHftaGTZzhQgcfvLBh5biFL3Wfr7eP5
W2M4T1jKhg7ZwgDMY5b6H13tpIfSwMizVtK3xUJXz9kCgYEA8kMRfcscMDFxE+tI
OFvYUr1wzVIhPan4nzEIjTH6t7fUOTFhNFuJm8jwP/ss0wBuqx6xu06nzwuOxtyH
HChDBHyn3loMgA7jIeLsVBhalj0fb7ph6MPrT50pVlTyInVV9WbjIyRx6wysD96U
orcTWoY4EaERKwE1whxoO9ox1r0CgYEA6snDS1S9DE35hXejHYN8Gct0ukfPC1xY
z0AJkv6st0wXY2jBUY523UpCWzUJgeBY/Aez4ZnPSbCFREM+A5F+XMvCuuxeXS0D
A7fehB7e3MB2Nbd2X8opUrOUP5EQCbWz5SnjwGhxHH9rRzBi882/DqcqMkMSBvna
UhMeZ71L0msCgYAh/1F8Er3Q8Y9J2VHYPuNbsSQcXDM4ARtX07y8e9AQaibJI+nd
PB9Skl9My0XeEoh1UShl/cLE5n1R4O7A/9Fv1sKEDKUGb5BmV/8MSiKkRM2dk01c
Kepi0M5VRDR6q3a1qoujieDGuI+I5pZ7Qy/fG0jRCIZtP404wV3LUHKADQKBgGxZ
mAqXnHalNVVmlJv2JbsxrTiaEu5HO6TJBKIVbVdZgiGaIjyk5i3RKzY0D6MkCWyl
kVm3RXXYRGfwMBotdocUcVUZ56JQN2fr3oBSTr7JAsRfWf1yqgdEYFHFfAU/GTnU
TwpoKGriUnuT1NZ2SIlWk56GXTdi7mGZ+RoevXLpAoGAYoZ095TQ7SACetGwj+ky
s1kNDHcjidcLOG6T/couQgVhb4ksZFUSsaatyCuhaygDosplU7os37HwWuRORaty
v9Pof0b9US2sjGNaeW3+nZiAIyuBqnRzi+yamJ0JEC3LBA2ffHo/jvEpwbmKU2IB
WdndvhVnyOiNZPW3PBExiJY=
-----END PRIVATE KEY-----
PEM
### Original
#my $pem = << 'PEM'; # this certificate is invalid, please only use for testing
#-----BEGIN CERTIFICATE-----
#MIIC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