最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Openssl script I use for PFX files (it's a script that extracts a key for a PFX file so you can use it with a new one) i

programmeradmin6浏览0评论

I have a script (bat file) I used at my last job to easily create new PFX files from .crt files when we didn't know the password to the old .PFX file.

Here is the script:

REM How to use:
REM 1. Export old cert with private key, remember password.
REM 2. Copy to this directory.
REM 3. Copy new cert to this directory.
REM 4. Fill out the SET variables below.
REM 5. Run this script, enter passwords. newpfx is the re-bundled cert you want to install on webserver. 

SET oldpfx=test.pfx 
SET newcert=test.crt 
SET newpfx=testa.pfx

bin\openssl.exe pkcs12 -in %oldpfx% -nocerts -out key.pem -nodes 
bin\openssl.exe pkcs12 -export -out %newpfx% -inkey key.pem -in %newcert% 

The issue with the above script is that on the last two lines, I always get "the system cannot find the path specified".

At my current job, I installed openssl via an MSI file to the c:\program files\openssl-win 64 and I place the required certs in the bin directory - that's also where the script is as well - the other directories are: exp, include, lib, & tests. Keep in mind that, that's not where it was installed at my last job, I was running he directory from c:\users\username.

The script never prompts me to enter the passwords either. This occurs whether I open the bat file in cmd prompt or powershell.

Any help would be appreciated.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论