我在 IIS 6 中有一个网站,其目录安全性设置为“需要安全通道 (SSL)”和“需要 128 位加密”。此外,客户端证书设置设置为“忽略客户端证书”。
当我在 Internet Explorer 和 Chrome 中点击https://servername/resource时,系统会提示我输入证书。我可以取消提示,资源就会加载,但我根本不想看到这个提示。我查看了网站内的虚拟目录和资源,它们都启用了忽略客户端证书设置。是否可能存在另一个设置(也许在元数据库中)覆盖网站的目录安全设置?
我在 Windows 7 上创建了一个自签名证书,并使用该证书部署了一个网站,只是为了尝试一下。
当我配置 HTTPS 端点并使用 HTTPS 协议访问站点时,我收到了预期的“不是受信任的证书”错误。
然后我尝试使用以下 PowerShell 代码使该证书成为我的计算机上的可信证书:
$cert = (get-item cert:\CurrentUser\MY\1D5B3DEF207B70C7426953315A8C06EB38E50FAA)
$store = get-item cert:\LocalMachine\Root
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
Run Code Online (Sandbox Code Playgroud)
它不起作用,我仍然遇到同样的错误。然后,我从受信任的证书列表中删除它并再次尝试使用以下代码:
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("c:\certs\foo2.foo.cc.cer")
$store = get-item cert:\LocalMachine\Root
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
Run Code Online (Sandbox Code Playgroud)
那也没用。我缺少什么?
我在我的网站上使用带有此标头的 HSTS:
Strict-Transport-Security: max-age=15768000; includeSubDomains
Run Code Online (Sandbox Code Playgroud)
这按预期工作并强制浏览器将所有 http 连接重定向到 https。
在https://www.rfc-editor.org/rfc/rfc6797#section-6.1.2的文档中,我没有找到排除指定子域的方法!
我已经尝试添加max-age=0子域,但它不会覆盖includeSubDomains
是否可以从includeSubDomains规则中排除子域?或者是删除此规则并仅对某些网站使用 HSTS 标头的唯一方法?PS:我的网络服务器是 NGINX,我使用 Firefox 和 Chrome 测试了该行为。
我想将所有 HTTP 和 HTTPS 流量重定向为squid充当透明代理。然后,该流量将在特定时间内被阻止或授权(批量)。具体来说,我不想解密/重新加密 HTTPS 流量,而是按原样推送。
HTTP 部分起作用,REDIRECT规则将shorewall所有打算发送到目标端口的流量传输80到模式下的侦听3128鱿鱼端口transparent。
同样的技巧对于端口443不起作用。
有关于如何为 HTTPS 流量设置透明代理的教程,但我发现的所有教程都描述了创建证书对来解密/重新加密流量 - 这是我不想做的事情。
鱿鱼维基提到 CONNECT 作为隧道 HTTPS 流量的一种方式,但添加http_access allow CONNECT all到配置(并禁用默认值deny)不会改变任何东西。
然后,之前的 一些答案表明,在不破坏 TLS 隧道的情况下,透明的 HTTPS 流量是不可能的。
因此:是否有一种方法可以配置,squid以便通过重新路由到它的 HTTPS 流量iptables然后透明地传输,而不需要任何修改?
(当满足某些时间规则时,我最终会阻止(这就是说,该阻止不会基于 HTTPS 流本身内的任何内容))
我\xe2\x80\x99m 在 Nginx 后面运行 Jenkins,并使用 Let\xe2\x80\x99s 加密 SSL 证书。如果我通过访问该网站https://jenkins.mydomain.de/,一切正常。但是当我通过 访问它时http://jenkins.mydomain.de/,Firefox 说 \xe2\x80\x9cConnection was Reset.\xe2\x80\x9d 并且curl 说 \xe2\x80\x9c来自服务器的空回复\xe2\x80\x9d
我该如何调试这个?我真的不知道在哪里寻找问题。nginx 日志 don\xe2\x80\x99t 包含任何有关它的信息。我怀疑下面配置中有关端口 80 的部分因其他指令而无效,但我不\xe2\x80\x99 不知道如何调查它。
\n\n$ curl -svL http://jenkins.mydomain.de/\n* Hostname was NOT found in DNS cache\n* Trying my.ip.add.ress...\n* Connected to jenkins.mydomain.de (my.ip.add.ress) port 80 (#0)\n> GET / HTTP/1.1\n> User-Agent: curl/7.38.0\n> Host: jenkins.mydomain.de\n> Accept: */*\n> \n* Empty reply from server\n* Connection #0 to host jenkins.mydomain.de left intact\nRun Code Online (Sandbox Code Playgroud)\n\n当使用 telnet 与服务器通信时,只要我按一次 return (即之后GET / HTTP/1.1 …
我试图尽可能多地跟进此线程,但我总是收到此消息:
This site can’t be reached
example.com unexpectedly closed the connection.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_CLOSED
ReloadHIDE DETAILS
Run Code Online (Sandbox Code Playgroud)
在铬。
我所拥有的配置部分是这样的:
server {
listen 80;
listen 443 default_server ssl;
#ssl on;
server_name example.com www.example.com;
Run Code Online (Sandbox Code Playgroud)
这是我在本地 127.0.0.1 计算机上的测试网站 example.com。
使用此处描述的方法来测量服务器响应时间,我可以看到time_appconnect、time_pretransfer、 和time_starttransfer非常高,但仅限于通过 HTTPS 访问网站时。
相比之下,连接到 Google 的速度非常快。
curl -w "@curl-format.txt" -o /dev/null -s "https://www.google.com"
Run Code Online (Sandbox Code Playgroud)
回报
time_namelookup: 0.014433
time_connect: 0.117187
time_appconnect: 0.374567
time_pretransfer: 0.374779
time_redirect: 0.000000
time_starttransfer: 0.513398
----------
time_total: 0.514880
Run Code Online (Sandbox Code Playgroud)
通过 HTTP 连接到我们的网站也相当快:
curl -w "@curl-format.txt" -o /dev/null -s "http://environmentaldashboard.org"
Run Code Online (Sandbox Code Playgroud)
回报
time_namelookup: 0.004136
time_connect: 0.044469
time_appconnect: 0.000000
time_pretransfer: 0.044554
time_redirect: 0.000000
time_starttransfer: 0.166275
----------
time_total: 0.166404
Run Code Online (Sandbox Code Playgroud)
但是通过 HTTPS 连接非常慢:
curl -w "@curl-format.txt" -o /dev/null -s "https://environmentaldashboard.org"
Run Code Online (Sandbox Code Playgroud)
回报
time_namelookup: 0.005211
time_connect: 0.057697 …Run Code Online (Sandbox Code Playgroud) 我使用 NGINX 服务器作为其他一些 NGINX 服务器的 ssl 代理。不幸的是,如果请求被上游服务器重定向,则位置字段包含错误的目标端口。
curl -v "https://example.com/site":
> GET /site HTTP/2
> Host: example.com
> User-Agent: curl/7.58.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 301
< server: nginx
< date: Sun, 18 Mar 2018 20:01:44 GMT
< content-type: text/html
< content-length: 178
< location: http://example.com:9101/site/
< strict-transport-security: max-age=15768000; includeSubDomains
Run Code Online (Sandbox Code Playgroud)
NGINX 代理:
# Proxy: example.com
####################
server {
listen 0.0.0.0:80;
listen [::]:80;
server_name example.com;
root /srv/www/_empty;
location / { return 301 https://example.com$request_uri; …Run Code Online (Sandbox Code Playgroud) 我希望根据我接收流量的端口将我的自定义 http 端口流量重定向到自定义 https 端口
我有多个绑定语句:
bind 1.2.3.4:7777
bind 1.2.3.4:8888
bind 1.2.3.4:9999 ssl crt /etc/haporxy/somecert.crt
Run Code Online (Sandbox Code Playgroud)
我试过的:
acl is7777 dst_port 7777
http-request redirect code 301 https://%[req.hdr(Host)]:9999%[capture.req.uri] if is7777
Run Code Online (Sandbox Code Playgroud)
但是,当我查看 Chrome 开发工具中的日志时,我总是看到 req.hdr(Host) 的值保留了旧端口的值,因此我被重定向到
https://1.2.3.4:7777/:9999/.
Run Code Online (Sandbox Code Playgroud)
如何仅获取域名并将其重定向到所需的目标端口 9999
此外,像这样的事情:
http-request replace-value Host (.*):7777 \1:9999
Run Code Online (Sandbox Code Playgroud)
由于稍后有多个重定向,因此中断了应用程序流程。我需要从 7777(http) 转到 9999(https) 。haproxy 版本:1.5
使用 CentOS 7,我尝试使用firewall-cmd --zone=public --add-port=443/tcp --permanent将 443 添加到我允许的端口。不幸的是,这会引发错误ALREADY_ENABLED: 443:tcp。但是当我使用firewall-cmd --list-ports它时并没有显示在列表中(“80/tcp 3000/tcp 26900/tcp 26900/udp”)。
我想这个问题是由 firewall-cmd 和 iptables 之间的冲突引起的。但我不知道如何调试它,以及这是否可能。
调用firewall-cmd --list-all结果如下表:
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh dhcpv6-client
ports: 80/tcp 3000/tcp 26900/tcp 26900/udp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Run Code Online (Sandbox Code Playgroud) https ×10
nginx ×4
ssl ×3
certificate ×2
firewall-cmd ×1
haproxy ×1
http ×1
http-headers ×1
iis ×1
iptables ×1
jenkins ×1
networking ×1
performance ×1
port ×1
powershell ×1
proxy ×1
redirect ×1
redirection ×1
rewrite ×1
squid ×1
windows-7 ×1