I hope this might help someone, this is how I got past the "unable to verify the first certificate" error. This was completed on RedHat server with a wildcard certificate.
Connect to your server and output the certificate as "logcertfile".
openssl s_client -connect <
example.com>:443 -servername <
example.com> | tee logcertfile
Grep for the issuer:
openssl x509 -in logcertfile -noout -text | grep -i "issuer"
Use the above issuer to get the issuer certificate. Use the below to get the issuercertificate and output it as intermediate.crt
curl --output intermediate.crt http://<issuer>/<some_certificate>.crt
Locate your Apache/HTTPD ssl.conf file look for "SSLCertificateFile", use this certificate for the below steps. Mine was in the PEM format, so I changed the format from CRT to PEM
openssl x509 -inform DER -in intermediate.crt -out intermediate.pem -text
Just to be safe, make a copy of the original certificate.
cp /etc/pki/tls/certs/<
example.com>.pem <
example.com>.pubcert.with.chain.pem
Append the intermediate.pem to your SSL certificate (SSLCertificateFile):
intermediate.pem >> /etc/pki/tls/certs/<
example.com>.pubcert.with.chain.pem
NOTE: this certificate will need to have all of your trusted certificates (chain) added to it.
Modify your ssl.conf file to point to the new certificate:
SSLCertificateFile /etc/pki/tls/certs/<
example.com>.pubcert.with.chain.pem
check then restart Apache/HTTPD
apachectl configtest
apachectl graceful
Add NODE_EXTRA_CA_CERTS to dspace’s .bash_profile:
export NODE_EXTRA_CA_CERTS='/etc/pki/tls/certs/<
example.com>.pubcert.with.chain.pem'
source ~/.bash_profile
or logout the back in again
Now you should be able run:
cd /dspace-angular-dspace-7.3/
yarn test:rest
RESPONSE: 200
Checking JSON returned for validity...
"dspaceVersion" = DSpace 7.2.2-SNAPSHOT
"dspaceUI" =
http://localhost:4000 "dspaceServer" = https://<
example.com>/server
"dspaceServer" property matches UI's "rest" config? true
Does "/api" endpoint have HAL links ("_links" section)? true
Done in 3.75s.
For testing you can use:
cd /dspace-ui-deploy
NODE_EXTRA_CA_CERTS='/etc/pki/tls/certs/<
example.com>.pubcert.with.chain.pem' node ./dist/server/main.js
To run in production:
cd /dspace-ui-deploy
Edit and add "NODE_EXTRA_CA_CERTS" to dspace-ui.json
{
"apps": [
{
"name": "dspace-ui",
"cwd": "/dspace-ui-deploy",
"script": "dist/server/main.js",
"env": {
"NODE_ENV": "production",
"NODE_EXTRA_CA_CERTS": "/etc/pki/tls/certs/<
example.com>.pubcert.with.chain.pem"
}
}
]
}
pm2 start dspace-ui.json
I hope I didn't leave anything out, I did this a couple weeks back.