jillybean 2 Posted April 4, 2021 Share Posted April 4, 2021 @schogobong I found a saved copy of my script which is slightly different to the original I posted. I think the main change (based on a post by Jibest that suggested the key didn't change) was to alter the 'find' to look at the time on the cert file rather than the key file - so: [[ -z `find cert -mmin -60` ]] rather than [[ -z `find key -mmin -60` ]] Link to comment Share on other sites More sharing options...
Simorgh 0 Posted January 16, 2023 Share Posted January 16, 2023 On 1/21/2019 at 6:09 PM, Jibest said: I've managed to answer most of those questions myself. You can automate the password when running the cmd by using -passout in the cmd. To have no password add the following: openssl pkcs12 -export -out certificate.pfx -inkey key -in cert -passout :pass if you want a password then use openssl pkcs12 -export -out certificate.pfx -inkey key -in cert -passout :passmypassword I've decided to re-generate the PFX twice a month to avoid it expiring but need to wait and see if there are any issues. To do this I wrote a simple script to run the cmd and then added the following to Crontab: 0 0 */15 * 6 /share/CE_CACHEDEV6_DATA/Files/Scripts/Create_Cert.sh Touch wood this will now take care if itself. Thank you for this post. It helped me to figure out how to create it with no typo in regards to -inkey But there is a typo when it comes to :pass and it should be pass: if no password, and pass:myPassWord if one wants a password To have no password: sudo openssl pkcs12 -export -out certificate.pfx -inkey key -in cert -passout pass: To have password: sudo openssl pkcs12 -export -out certificate.pfx -inkey key -in cert -passout pass:MyPassWord Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now