Ssl

IPv6 上的 HTTPS 僅在我的區域網路內工作(HTTP 很好)

  • February 26, 2019

我正在嘗試將 Web 伺服器公開到 Internet。

套接字顯然沒問題:

$ ss -tupan -6 state listening | grep node
tcp    0      128            *:7443                       *:*                   users:(("node-default",pid=28327,fd=26))
tcp    0      128            *:7777                       *:*                   users:(("node-default",pid=28327,fd=25))

我在路由器的防火牆和伺服器的防火牆上公開了埠 7777 和 7443。

$ firewall-cmd --list-all --zone=home
home (active)
 target: default
 icmp-block-inversion: no
 interfaces: wlan0
 sources: 
 services: ssh mdns samba-client dhcpv6-client samba openvpn
 ports: 7777/tcp 7443/tcp
 protocols: ipv6-icmp
 masquerade: no
 forward-ports: 
 source-ports: 
 icmp-blocks: 
 rich rules: 

據我所知,HTTP 執行良好:

[http://$$ xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx $$:7777/]](http://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:7777/])

不幸的是,到目前為止 https 只能從我的區域網路內部訪問:

https://$$ xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx $$:7443

關於問題可能是什麼/如何進一步排除故障的任何想法?

PS:我現在使用的是自簽名證書。


更新 1:iptables 規則

$ ip6tables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
14796   14M ACCEPT     all      *      *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
1938  155K ACCEPT     all      lo     *       ::/0                 ::/0                
 861 98439 INPUT_direct  all      *      *       ::/0                 ::/0                
 861 98439 INPUT_ZONES_SOURCE  all      *      *       ::/0                 ::/0                
 861 98439 INPUT_ZONES  all      *      *       ::/0                 ::/0                
   0     0 LOG        all      *      *       ::/0                 ::/0                 ctstate INVALID LOG flags 0 level 4 prefix "STATE_INVALID_DROP: "
   0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID
  20  2013 LOG        all      *      *       ::/0                 ::/0                 LOG flags 0 level 4 prefix "FINAL_REJECT: "
  20  2013 REJECT     all      *      *       ::/0                 ::/0                 reject-with icmp6-adm-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
   0     0 ACCEPT     all      *      *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
   0     0 ACCEPT     all      lo     *       ::/0                 ::/0                
   0     0 FORWARD_direct  all      *      *       ::/0                 ::/0                
   0     0 FORWARD_IN_ZONES_SOURCE  all      *      *       ::/0                 ::/0                
   0     0 FORWARD_IN_ZONES  all      *      *       ::/0                 ::/0                
   0     0 FORWARD_OUT_ZONES_SOURCE  all      *      *       ::/0                 ::/0                
   0     0 FORWARD_OUT_ZONES  all      *      *       ::/0                 ::/0                
   0     0 LOG        all      *      *       ::/0                 ::/0                 ctstate INVALID LOG flags 0 level 4 prefix "STATE_INVALID_DROP: "
   0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID
   0     0 LOG        all      *      *       ::/0                 ::/0                 LOG flags 0 level 4 prefix "FINAL_REJECT: "
   0     0 REJECT     all      *      *       ::/0                 ::/0                 reject-with icmp6-adm-prohibited

Chain OUTPUT (policy ACCEPT 15085 packets, 2863K bytes)
pkts bytes target     prot opt in     out     source               destination         
15681 3011K OUTPUT_direct  all      *      *       ::/0                 ::/0                

Chain FORWARD_IN_ZONES (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDI_home  all      wlan0  *       ::/0                 ::/0                [goto] 
   0     0 FWDI_public  all      +      *       ::/0                 ::/0                [goto] 

Chain FORWARD_IN_ZONES_SOURCE (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD_OUT_ZONES (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDO_home  all      *      wlan0   ::/0                 ::/0                [goto] 
   0     0 FWDO_public  all      *      +       ::/0                 ::/0                [goto] 

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD_direct (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_home (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDI_home_log  all      *      *       ::/0                 ::/0                
   0     0 FWDI_home_deny  all      *      *       ::/0                 ::/0                
   0     0 FWDI_home_allow  all      *      *       ::/0                 ::/0                
   0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                

Chain FWDI_home_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_home_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_home_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_public (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDI_public_log  all      *      *       ::/0                 ::/0                
   0     0 FWDI_public_deny  all      *      *       ::/0                 ::/0                
   0     0 FWDI_public_allow  all      *      *       ::/0                 ::/0                
   0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                

Chain FWDI_public_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_public_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDI_public_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_home (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDO_home_log  all      *      *       ::/0                 ::/0                
   0     0 FWDO_home_deny  all      *      *       ::/0                 ::/0                
   0     0 FWDO_home_allow  all      *      *       ::/0                 ::/0                

Chain FWDO_home_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_home_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_home_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_public (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 FWDO_public_log  all      *      *       ::/0                 ::/0                
   0     0 FWDO_public_deny  all      *      *       ::/0                 ::/0                
   0     0 FWDO_public_allow  all      *      *       ::/0                 ::/0                

Chain FWDO_public_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_public_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain FWDO_public_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain INPUT_ZONES (1 references)
pkts bytes target     prot opt in     out     source               destination         
 753 87315 IN_home    all      wlan0  *       ::/0                 ::/0                [goto] 
  34  3461 IN_public  all      +      *       ::/0                 ::/0                [goto] 

Chain INPUT_ZONES_SOURCE (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain INPUT_direct (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain IN_home (1 references)
pkts bytes target     prot opt in     out     source               destination         
 827 94978 IN_home_log  all      *      *       ::/0                 ::/0                
 827 94978 IN_home_deny  all      *      *       ::/0                 ::/0                
 827 94978 IN_home_allow  all      *      *       ::/0                 ::/0                
 719 80600 ACCEPT     icmpv6    *      *       ::/0                 ::/0                

Chain IN_home_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:22 ctstate NEW
  77 11842 ACCEPT     udp      *      *       ::/0                 ff02::fb             udp dpt:5353 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:137 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:138 ctstate NEW
   1   136 ACCEPT     udp      *      *       ::/0                 fe80::/64            udp dpt:546 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:137 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:138 ctstate NEW
   0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:139 ctstate NEW
   0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:445 ctstate NEW
   0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpts:1714:1764 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpts:1714:1764 ctstate NEW
   0     0 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:1194 ctstate NEW
  16  1280 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:7777 ctstate NEW
  14  1120 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:7443 ctstate NEW
   0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ctstate NEW

Chain IN_home_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain IN_home_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain IN_public (1 references)
pkts bytes target     prot opt in     out     source               destination         
  34  3461 IN_public_log  all      *      *       ::/0                 ::/0                
  34  3461 IN_public_deny  all      *      *       ::/0                 ::/0                
  34  3461 IN_public_allow  all      *      *       ::/0                 ::/0                
  14  1448 ACCEPT     icmpv6    *      *       ::/0                 ::/0                

Chain IN_public_allow (1 references)
pkts bytes target     prot opt in     out     source               destination         
   0     0 ACCEPT     udp      *      *       ::/0                 fe80::/64            udp dpt:546 ctstate NEW

Chain IN_public_deny (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain IN_public_log (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT_direct (1 references)
pkts bytes target     prot opt in     out     source               destination

更新 2 - 路由器規則:

路由器規則

路由器是華碩DSL-AC68U

我可以從我的網路訪問這個 url:

https://$$ xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx $$:7443/

我在 Firefox 中收到證書警告錯誤,發給 selfcert.local, SHA-1 指紋52:52:AB:48:BA:75:74:85:8E:F4:5A:46:46:E6:47:CB:CE:6A:D4:36

可能與您的配置有關,例如華碩韌體或其他設備未正確路由其自己的 IPv6 網路。從我的 IPv6 網路到您的網路,連接正常,我收到您的自簽名證書。

引用自:https://serverfault.com/questions/955705