gpt4 book ai didi

ssl - ColdFusion CFHTTP 和 SSL 证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:52:45 24 4
gpt4 key购买 nike

背景: 当我尝试使用 CFHTTP 连接到 API 时,我一直遇到连接失败错误消息的问题。在查看 SoapUI 中的 API 时,我注意到有一个按钮 SSL Info (3 certs),概述如下。当我单击该按钮时,会弹出一个副本窗口,其中概述了下面的标题。

“SSL 信息(3 个证书)”

CipherSuite:

PeerPrincipal

Peer Certificate 1:

Peer Certificate 2:

Peer Certificate 3:

我觉得这些是让我的应用程序正确连接和提取 JSON 的关键。

问题:我如何或在哪里安装此证书信息。我是否应该使用证书信息复制窗口中的所有 310 行并将其放入新文件并将其保存在某个地方?

任何信息都会很棒。

最佳答案

之前我已经回答过安装证书的问题。这里再次提供一些步骤,让您免于搜索……

如果您使用 cfhttp要通过 SSL (https) 连接,那么 ColdFusion 服务器肯定需要安装证书才能成功连接。这是我之前对类似问题的回答:

为了将证书安装到 ColdFusion 的 Java keystore ,您需要执行以下步骤。首先,确保您正在更新 ColdFusion 使用的正确的 cacerts 文件。如果您在该服务器上安装了多个 JRE。您可以在“系统信息”下从管理员处验证正在使用的 JRE ColdFusion。查找 Java 主页行。

The default truststore is the JRE's cacerts file. This file is typically located in the following places:

  • Server Configuration:

    cf_root/runtime/jre/lib/security/cacerts

  • Multiserver/J2EE on JRun 4 Configuration:

    jrun_root/jre/lib/security/cacerts

  • Sun JDK installation:

    jdk_root/jre/lib/security/cacerts

  • Consult documentation for other J2EE application servers and JVMs

要安装证书,您需要先获取证书的副本。这可以通过使用 Internet Explorer 来完成。 请注意,不同版本的 Internet Explorer 的行为略有不同,但这些步骤应该非常相似。例如,早期版本的 IE 可能会将证书保存在与我提到的不同的选项卡下。

  1. 在 Internet Explorer 中浏览到 SSL URL - https://xyz/infoLookup.php?wsdl .
  2. 通过单击锁定图标 并单击查看证书来查看证书
  3. 然后单击“安装证书...”按钮(注意:如果您没有看到此按钮,您必须先关闭 IE 并以管理员身份运行它)
  4. 点击 IE 的 Internet 选项,然后点击内容标签
  5. 点击证书按钮
  6. 在“中间证书颁发机构”选项卡下找到服务器的证书,选择证书并单击“导出...”按钮
  7. 使用 DER 格式导出

将导出的证书文件复制到您的 ColdFusion 服务器(如果需要,您可以从 IE 中删除证书)

  1. 运行 cmd在 ColdFusion 服务器上以管理员身份提示
  2. 备份原始 cacerts 文件以备不时之需

The keytool is part of the Java SDK and can be found in the following places:

  • Server Configuration:

    cf_root/runtime/bin/keytool

  • Multiserver/J2EE on JRun 4 Configuration:

    jrun_root/jre/bin/keytool

  • Sun JDK installation:

    jdk_root/bin/keytool

  • Consult documentation for other J2EE application servers and JVMs

安装证书:

  1. 将目录更改为信任库的位置(cacerts 文件所在的位置)
  2. 键入此命令(使用当前 jvm 并使用当前 jvm 的 keytool)"c:\program files\java\jre7\bin\keytool" -import -v -alias your_cert_alias_name -file C:\wherever_you_saved_the_file\cert_file.cer -keystore cacerts -storepass changeit
  3. 在提示“信任此证书?”时键入 yes

注意:your_cert_alias_name我上面用的可以是任何你想要的
注意:C:\wherever_you_saved_the_file\cert_file.cer 将这些值更改为您用于服务器文件夹和证书文件名的值

验证证书:

  1. 键入此命令(使用当前 jvm 并使用当前 jvm 的 keytool)"c:\program files\java\jre7\bin\keytool" -list -v -keystore cacerts -alias your_cert_alias_name -storepass changeit

注意:your_cert_alias_name 在此处使用您在上面用于安装证书的相同名称

重新启动 ColdFusion 服务在您执行此操作之前,它不会读取更新的 cacerts 文件。

您可以根据需要从服务器删除导入的证书文件。

关于ssl - ColdFusion CFHTTP 和 SSL 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37313011/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com