Using encryption appears: DSO support routines:win32_load:could not load the shared library

Gan, I finally solved this problem today. It used to be a very strange bug. As long as encryption is involved in the window system, this problem will always occur, such as crypto, WeChat payment, Alipay payment.. Google can't find any The answer is, but there is no problem in deploying it to linux, so the subsequent operations are synchronized to the server for modification. This time I encounter this problem again and I want to solve it for him.

Error message:

**

Error: error:25078067:DSO support routines:win32_load:could not load the shared library
    at Sign.sign (node:internal/crypto/sig:131:29)
    at Object.sign (项目路径\node_modules\alipay-sdk\lib\util.js:94:34)
    at AlipaySdk.pageExec (项目路径\node_modules\alipay-sdk\lib\alipay.js:168:33)
    at AlipaySdk.exec (项目路径\node_modules\alipay-sdk\lib\alipay.js:263:25)
    at createOrder (项目路径\createOrder.js:46:37)
    at asyncCreate (项目路径\server.js:47:30)
    at 项目路径\server.js:50:5
    at Layer.handle [as handle_request] (项目路径\node_modules\express\lib\router\layer.js:95:5)
    at next (项目路径\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (项目路径\node_modules\express\lib\router\route.js:112:3) {
  opensslErrorStack: [
    'error:0E076071:configuration file routines:module_run:unknown module name',
    'error:0E07506E:configuration file routines:module_load_dso:error loading dso',
    'error:25070067:DSO support routines:DSO_load:could not load the shared library'
  ],
  library: 'DSO support routines',
  function: 'win32_load',
  reason: 'could not load the shared library',
  code: 'ERR_OSSL_DSO_COULD_NOT_LOAD_THE_SHARED_LIBRARY'
}
复制代码

Why did the error occur:
Because I needed to pack the key file in the early days, I downloaded the openssl installation package from the official website to install it, but I didn't use it later, so I threw it there and didn't uninstall it.

Because the connected Alipay and WeChat payment will use the crypto library, this library will call the system's openssl to compile? But there may be a problem with my own installation or the version is not correct, which makes it impossible to call.

Solution:

  1. If openssl is already installed on the system, how to judge that it is already installed? Uninstall, or delete system environment variables (find openssl)
  2. Install git (general programmer systems come with this, which can be ignored)
  3. Add system environment variable (Path)

**

git的安装目录\usr\bin 例如:D:\System\Git\usr\bin
复制代码

Test the input in the command operator window to opensslsee if it can be used

That's it, so that we just call the openssl that comes with git directly, so we don't have to install it manually, and avoid all kinds of problems.

Reference:
ssl - How to install OpenSSL in windows 10? - Stack Overflow

Guess you like

Origin juejin.im/post/7077868860296134664