Squid always send the signing certificate to the ssl_crtd daemon even for
self-signed certificates because the signing certificate may used for cert
adaptation algorithms. The ssl_crtd currently ignore the signing certificate
in the case of self-signed certificates. This is has as result to
use a random number as serial number of generated certificate.
This patch also use 0 as serial number of the temporary intermediate certificate
used to generate the final serial number of the certificate, in the case of
signing certificate is not given.
else
certProperties.signAlgorithm = Ssl::algSignTrusted;
- if (certProperties.signAlgorithm != Ssl::algSignSelf &&
- !Ssl::readCertAndPrivateKeyFromMemory(certProperties.signWithX509, certProperties.signWithPkey, certs_part.c_str())) {
+ if (!Ssl::readCertAndPrivateKeyFromMemory(certProperties.signWithX509, certProperties.signWithPkey, certs_part.c_str())) {
error = "Broken signing certificate!";
return false;
}
Ssl::X509_Pointer fakeCert;
serial.reset(x509Pubkeydigest(properties.signWithX509));
+ if (!serial.get()) {
+ serial.reset(BN_new());
+ BN_is_zero(serial.get());
+ }
if (!generateFakeSslCertificate(fakeCert, fakePkey, properties, serial))
return false;