windows - 处理公司防火墙添加自签名证书

标签 windows ssl networking certificate composer-php

我在一家大公司的一个小团队工作。

所有网络流量都经过公司的防火墙,我认为当任何流量进入时,防火墙就像中间人。

我看到的一个例子是使用 curl

c:\>curl https://www.google.com
curl: (60) SSL certificate problem: self signed certificate in certificate chain

所以我检查证书链:

c:\>openssl s_client -connect google.com:443

然后返回(删除了一些细节)

Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
   i:/C=US/My Company's Intermediate CA
 1 s:/C=US/My Company's Intermediate CA
   i:/C=US/My Company's Root CA
 2 s:/C=US/My Company's Root CA
   i:/C=US/My Company's Root CA

这为使用像 npm 这样的包管理器带来了挑战。或 composer因为所有 https 由于自签名证书错误而失败,或者根本无法验证证书

我可以得到 npm通过设置配置值 ca=""strict-ssl=false 来工作,但这是一种不安全的做法。

我希望我们的开发团队能够访问包管理器,特别是 npmcomposer

鉴于我无法更改防火墙的工作方式,我是否可以在本地计算机 (Windows 7) 或虚拟机 (Windows server 2008 R2) 上进行任何更改,以允许我们的开发团队完全安全地使用这些包管理器。

谢谢!!

最佳答案

我在公司四处打听,最终找到了合适的人,他说:

All our internet traffic passes through COMPANY. COMPANY intercepts all HTTPS traffic, replaces the certificate and then adds their own certificate. This is so they can decrypt and analyze all encrypted traffic (essentially a man in the middle attack).
The COMPANY root certificate must be trusted to avoid warnings and errors.

我得到了一个链接,指向我可以在哪里下载正确的 pem key 。

使用该 key ,我能够为各种包管理器设置正确的配置选项。

npm

npm config set cafile C:\\path\\to\\cert.pem
npm config set strict-ssl true

(在 Windows 中需要双反斜线)

Composer

必须在 php.ini 中设置某些值才能使 Composer 工作。

openssl.cafile = C:\path\to\cert.pem
curl.cainfo = C:\path\to\cert.pem

对于引发证书错误的任何其他程序(未验证、自签名等),我最终找到了某种配置设置,我可以在其中指向该 pem 文件并让所有程序正常工作。

关于windows - 处理公司防火墙添加自签名证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39639860/

相关文章:

networking - 在 docker-compose.yml 中绑定(bind)主机端口时无法将服务扩展到多个容器

c# - 以编程方式将访问控制列表 (ACL) 权限分配给 'this folder, subfolders and files'

python - 如何将 Huey 连接到 Flask 应用程序

php - 使用 PHP 生成 Windows .lnk 文件

oracle - ORA-28860 : Fatal SSL error when using UTL_HTTP?

delphi - Indy 10 - IdHTTP.Get 提高 "Could not load SSL library"

Python ssl/https requests.get 调用失败

c# - C# 中的分层服务提供程序

windows - tortoisehg 工作台 : convert extension is disabled

python - 为什么 scapy 不捕获 VLAN 标记信息?