全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1664|回复: 16
打印 上一主题 下一主题

老话重提。2022年都快过完了还有人做假证书防止IP泄漏

[复制链接]
跳转到指定楼层
1#
发表于 2023-11-16 06:52:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 你号没了 于 2023-11-16 07:05 编辑

https://lilynana.eu.org/thread-1058244-1-1.html
这个主题帖看不到原楼主的内容了。
采集站里面看是以下内容
  1. 2022年都快过完了还有人做假证书防止IP泄漏的???
  2. Nginx从2020年发布的1.19.4版本开始就内置了更好的方式啊,
  3. Syntax: ssl_reject_handshake on | off;
  4. Default: ssl_reject_handshake off;
  5. Context: http, server
  6. This directive appeared in version 1.19.4.
  7. If enabled, SSL handshakes in the server block will be rejected.
  8. For example, in the following configuration, SSL handshakes with server names other than example.com are rejected:
  9. server {
  10. listen 443 ssl default_server;
  11. ssl_reject_handshake on;
  12. }
  13. server {
  14. listen 443 ssl;
  15. server_name example.com;
  16. ssl_certificate example.com.crt;
  17. ssl_certificate_key example.com.key;
  18. }
复制代码


nginx怎么配置啊
  1. listen 443 ssl default_server;
  2. ssl_reject_handshake on;
  3. }
复制代码

加上这个off开关就可以了吗
2#
发表于 2023-11-16 07:28:57 | 只看该作者
谁用假的呀,当然是上真证书。
3#
发表于 2023-11-16 07:29:51 | 只看该作者
本帖最后由 akamai 于 2023-11-16 07:35 编辑

用自带源的话,debian 12 ubuntu 23.04以后才是 1.19.4以后版本。rh系不清楚。
自己编译,动态模块每次更新都要重新折腾。
4#
发表于 2023-11-16 08:06:26 来自手机 | 只看该作者
ubuntu22.04 ngx 1.18
5#
发表于 2023-11-16 08:08:07 来自手机 | 只看该作者
还有一堆人用centos7。用假证书还可以问候一下偷邻居证书的马
6#
发表于 2023-11-16 09:24:59 | 只看该作者
要加个 ssl handshake timeout 不然容易 idle 连接
7#
 楼主| 发表于 2023-11-16 09:27:55 | 只看该作者
iks 发表于 2023-11-16 09:24
要加个 ssl handshake timeout 不然容易 idle 连接

好的。感谢大佬指点
  1. server {
  2.     listen 443 ssl default_server;
  3.     ssl_reject_handshake on;
  4.     ssl_handshake_timeout 5s;  # 设置为 5 秒钟
  5. }
复制代码
8#
 楼主| 发表于 2023-11-16 09:29:26 | 只看该作者
Starting nginx... nginx: [emerg] "ssl_handshake_timeout" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:76
9#
发表于 2023-11-16 09:44:19 | 只看该作者
你号没了 发表于 2023-11-16 09:29
Starting nginx... nginx: [emerg] "ssl_handshake_timeout" directive is not allowed here in /usr/local ...

草,我给的 key 不一定对,google 一下 8
10#
 楼主| 发表于 2023-11-16 09:50:29 | 只看该作者
本帖最后由 你号没了 于 2023-11-16 09:52 编辑
iks 发表于 2023-11-16 09:44
草,我给的 key 不一定对,google 一下 8


  问gpt一会说放http模块  一会说放server     

nginx version: nginx/1.22.0
  1. user  www www;

  2. worker_processes auto;
  3. worker_cpu_affinity auto;

  4. error_log  /home/wwwlogs/nginx_error.log  crit;

  5. pid        /usr/local/nginx/logs/nginx.pid;

  6. #Specifies the value for maximum file descriptors that can be opened by this process.
  7. worker_rlimit_nofile 51200;

  8. events
  9. {
  10.     use epoll;
  11.     worker_connections 51200;
  12.     multi_accept off;
  13.     accept_mutex off;
  14. }

  15. http
  16. {
  17.     include       mime.types;
  18.     default_type  application/octet-stream;

  19.     server_names_hash_bucket_size 128;
  20.     client_header_buffer_size 32k;
  21.     large_client_header_buffers 4 32k;
  22.     client_max_body_size 50m;

  23.     sendfile on;
  24.     sendfile_max_chunk 512k;
  25.     tcp_nopush on;

  26.     keepalive_timeout 60;

  27.     tcp_nodelay on;

  28.     fastcgi_connect_timeout 300;
  29.     fastcgi_send_timeout 300;
  30.     fastcgi_read_timeout 300;
  31.     fastcgi_buffer_size 64k;
  32.     fastcgi_buffers 4 64k;
  33.     fastcgi_busy_buffers_size 128k;
  34.     fastcgi_temp_file_write_size 256k;

  35.     gzip on;
  36.     gzip_min_length  1k;
  37.     gzip_buffers     4 16k;
  38.     gzip_http_version 1.1;
  39.     gzip_comp_level 2;
  40.     gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
  41.     gzip_vary on;
  42.     gzip_proxied   expired no-cache no-store private auth;
  43.     gzip_disable   "MSIE [1-6]\.";

  44.     #limit_conn_zone $binary_remote_addr zone=perip:10m;
  45.     ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

  46.     server_tokens off;
  47.     access_log off;

  48.     server
  49.     {
  50.         listen 80 default_server reuseport;
  51.         #listen [::]:80 default_server ipv6only=on;
  52.         server_name _;
  53.         return 444;
  54.         access_log off;
  55.     }

  56.     server
  57.     {
  58.         listen 443 ssl http2;
  59.         server_name _;
  60.         ssl_reject_handshake on;
  61.         ssl_handshake_timeout 5s;
  62.         access_log off;
  63.     }

  64.     include vhost/*.conf;
  65. }
复制代码

Starting nginx... nginx: [emerg] "ssl_handshake_timeout" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:77
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-12 02:24 , Processed in 0.063869 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表