I have a set of keys that authenticate me to some external server. They all use a root CA that's not installed in common distributions.
I am validating if the external server responds, using a Docker image.
This is in GitLab CI script so I am keeping it in that format.
CPI avail Ubuntu: stage: checkCpiAvailability image: ubuntu:18.04 script: - apt update - apt install -y curl wget unzip openssl openssh-client - openssl version - test/bench/curl/curlRequest.sh
curl -v \ --cacert "$SCRIPT_DIR/target/....crt" \ --key "$SCRIPT_DIR/target/temp.$KEY_FILENAME.private.key" \ --cert "$SCRIPT_DIR/target/temp.$KEY_FILENAME.client.crt:$KEY_PASS2" \ --header "Content-Type: application/soap+xml; charset=utf-8" \ --data "@$SCRIPT_DIR/../soapSamples/queryRequest-sampleFromSpec.xml" \ "$SERVICE_URL" \
When I do it with Ubuntu image, it works.
But when I do the same with Centos 7 image, it fails.
CPI avail Centos7: stage: checkCpiAvailability image: centos:7 script: - yum -y update - yum -y install curl wget unzip openssl openssh-clients - openssl version - test/bench/curl/curlRequest.sh
* unable to load client key: -8178 (SEC_ERROR_BAD_KEY) * NSS error -8178 (SEC_ERROR_BAD_KEY) * Peer's public key is invalid. * Closing connection 0 curl: (58) unable to load client key: -8178 (SEC_ERROR_BAD_KEY)
There are questions on SO that solve this error but I wonder whether it's my fault if it's working with the Ubuntu image.
Do I need to install something additional? Or does Centos have some different setup and needs e.g. a passphrase for the keys as I read in one of the answers? How can I make it the same as in Ubuntu?