We are trying to setup SSL on our application running on Wordpress, PHP, Apache. After doing the necessary configuration changes, we get the following error on curl command -
[root@www ~]# curl https://www.<domain name> -v
* About to connect() to www.<domain name> port 443 (#0)
* Trying 192.168.1.5...
* Connected to www.<domain name> (<domain IP>) port 443 (#0)
* Initializing NSS with certpath: sql:/sql/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
* CApath: none
* NSS error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG)
* SSL received a record that exceeded the maximum permissible length.
* Closing connection 0
* curl: (35) SSL received a record that exceeded the maximum permissible length.
[root@www ~]#
We noticed the .crt file name here (/etc/pki/tls/certs/ca-bundle.crt
) is different from what we have set in the SSL config file - /etc/pki/tls/certs/<domain name>.crt
.
We followed these steps -
- Found the effective httpd.conf file using
ps aux | grep httpd
- Configured
SSLCertificateFile
andSSLCertificateKey
inapache/conf/ssl.conf
-
https://freeimage.host/i/UQ6Zxt
Made changes to httpd.conf -
Listen 443
ServerName
www.<domain name>:443
Restarted httpd service.
Also checked that PHP configurations shows the following on phpinfo()
output -
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
openssl
Openssl default config => /etc/pki/tls/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
On checking this file, we found -
[ CA_default ]
dir = /etc/pki/CA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file
Here as well, I don't see the .pem and .crt files that are being referenced in the curl output, so I am clueless.
I have checked this question as well and verified Open ssl extension loaded using https://www.php.net/manual/en/function.extension-loaded.php.
The network/server administration team that provided the above details said that something configured at Wordpress end could be causing this scenario. Do you think this makes sense?
Update
Following is also set on ssl.conf file of Apache -
SSLEngine on
Also, following is the entire ssl.conf file (removing all commented lines) -
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName www.<domain name>:443
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
SSLHonorCipherOrder on
SSLCertificateFile /etc/pki/tls/certs/<domain name>.crt
SSLCertificateKeyFile /etc/pki/tls/private/<domain name>.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>