在NaiveProxy上使用IP的TLS证书

前言

群友问能否不使用域名搭NaiveProxy
正在我准备回复 "No" 的时候, 我想到了最近不是Caddy支持了IP证书嘛, 能不能结合在一起玩玩?

思路

现成的脚本生成配置文件和各种参数.
结果是这样的
# _naive_config_begin_
{
  order forward_proxy first
}
:2083, np.icdyct.dpdns.org:2083 {
  tls e16d9cb045d7@gmail.com
  forward_proxy {
    basic_auth 864aeebd36be 864aeebd36be
    hide_ip
    hide_via
    probe_resistance
  }
  file_server {
    root /var/www/xkcdpw-html
  }
}
# _naive_config_end_

最近Caddy支持IP证书的语法
是这样的
74.48.9.95 {
  tls {
    issuer acme {
      profile shortlived
    }
  }

  file_server {
    root /var/www/xkcdpw-html
  }
}

融合一下, 结果是这样的
# _naive_config_begin_
{
  order forward_proxy first
}
:2083 74.48.9.95:2083 {
  tls {
    issuer acme {
      profile shortlived
    }
  }
  
  forward_proxy {
    basic_auth 864aeebd36be 864aeebd36be
    hide_ip
    hide_via
    probe_resistance
  }
  file_server {
    root /var/www/xkcdpw-html
  }
}
# _naive_config_end_

实践

现成的脚本, 带参数执行, 跳过域名解析IP的校验检查, 直接生成配置文件.
把IP放到原本是域名的参数位置上
bash <(curl -L https://github.com/crazypeace/naive/raw/main/install.sh) 74.48.9.95 4 2083

修改配置文件 Caddyfile
把 
tls e16d9cb045d7@gmail.com
改为
tls {
  issuer acme {
    profile shortlived
  }
}

重启 caddy.service
systemctl restart caddy.service

========


评论

The Hot3 in Last 7 Days

酒馆SillyTavern 玩英文角色卡 也能以中文输出 设置世界书Lorebooks

Woiden IPv6 VPS 搭 V2ray 梯子 VLESS+Websocket+TLS 模式 免费 白嫖 全程手机操作 2022-4-19

极简一键脚本 搭Xray梯子 VLESS + Reality + xTLS 偷 x25519 证书