如何解决开发环境中的证书错误?

发布于 2024-11-17 13:18:18 字数 217 浏览 3 评论 0原文

我们拥有来自 VeriSign 的域名证书。然而,我试图对我们的开发环境进行一些测试,但不断收到证书错误(因为开发 IP 与我们注册证书的生产 IP 不匹配),这让我非常头疼。我似乎无法确定我遇到的问题是否是所做更改的一部分,或者问题是否源于证书错误。

我尝试添加 IE 的注册表项以不关心这些错误,但这似乎没有帮助。

无论如何,我是否可以解决这个问题,而不必为我的开发环境购买更多证书?

We have certificates from VeriSign for our domains. However, I am trying to do some testing on our development environment and keep getting certificate errors (since the development IPs don't match production IP's, which we registered the certificate with) and is causing me quite the headache. I can't seem to pinpoint if the issues I am encountering are part of the changes done or if the issues stem from certificate errors.

I have tried adding the Registry key for IE to not care about these errors, but that doesn't seem to help.

Is there anyway I can get around this issue without having to buy more certificates for my development environment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

固执像三岁 2024-11-24 13:18:18

有两种选择。第一个需要对代码进行较少的更改,并且涉及为开发服务器创建新证书,而不是重复使用生产证书。您不必购买它们,它们可以自签名。我建议您仅使用开发证书创建一个新的信任库,并在运行程序时指定信任库。 java -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=123456 MyApp 您还可以将开发服务器的证书添加到 JDK 的默认 cacerts 文件中,该文件通常在 Windows 上位于 C: \Program Files\Java\jre6\lib\security\cacerts。此选项的安全性较低,但您不必更改启动客户端的方式。

第二个选项涉及更改您的开发代码以忽略这些错误。这通常涉及创建您自己的 TrustManger 并将其传递到 SSLSocketFactory。这是一个很好的示例:http://exampledepot.com/egs/javax.net。 ssl/TrustAll.html 我不喜欢这个选项,因为您可能会向不验证服务器证书的项目提交不安全的代码。

There are two options. The first one requires less changes to your code and it involves creating new certificates for your development servers instead of reusing the production ones. You don't have to buy them, they can be self signed. I recommend you create a new TrustStore with just the development certificates, and that you specify the truststore when your run your program. java -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=123456 MyApp You can also add the dev server's certificates to the JDK's default cacerts file typically found on Windows at C:\Program Files\Java\jre6\lib\security\cacerts. This option is less secure but you don't have to change the way you start up the client.

The second options involves changing your your development code to ignore these errors. This usually involves creating your own TrustManger and passing that into the SSLSocketFactory. Here's a good example: http://exampledepot.com/egs/javax.net.ssl/TrustAll.html I don't like this option because you might commit unsafe code to your project that isn't verifying the server's certificates.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文