Re: https://www.ssl.com/how-to/create-a-pfx-p12-certificate-file-using-openssl/
Store the private key into privateKey.key (copy)
Store the certificate (endpoint cert only) into certificate.crt
openssl pkcs12 -export -out certificate.p12 -inkey privateKey.key -in certificate.crt
then test with
Convert p12 to PEM (maybe mac OSX only)
openssl pkcs12 -in certificate.p12 -out smsp.pem -nodes -clcerts
then use this to test the certificate (this worked on mac OSX) Get the getNHSNumber.xml file from information in the SMSP opentest page
curl -i -X POST -H "SOAPAction: urn:nhs-itk:services:201005:getNHSNumber-v1-0" -H "content-type: text/xml" -E smsp.pem -k https://192.168.128.11/smsp/pds -d @getNHSNumber.xml
Once ok, import the p12 file into java keystore
keytool -importkeystore -destkeystore keystore.jks -srckeystore certificate.p12 -srcstoretype PKCS12
Now need to import the servers certificate into the store to trust it
openssl s_client -connect 192.168.128.11:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
keytool -import -alias SMSPSRVR -keystore cacerts.jks -file public.crt
In this directory
mvn install
docker build . -t smsp-adaptor
docker tag smsp-adaptor thorlogic/smsp-adaptor
docker push thorlogic/smsp-adaptor