stilleshan / frpc

基于原版 frp 内网穿透客户端 frpc 的一键安装卸载脚本和 docker 镜像.支持群晖NAS,Linux 服务器和 docker 等多种环境安装部署.
https://hub.docker.com/r/stilleshan/frpc
660 stars 189 forks source link

HTTPS配置提示无法找到证书 #8

Closed Dev-Wiki closed 2 years ago

Dev-Wiki commented 2 years ago

使用环境为 威联通的 nas, http 配置正常.

2022/03/13 18:19:11 [W] [control.go:179] [d72a10e8af15e80a] [devwiki_nginx_https] start error: gen TLS config error: open ./ssl/nginx.crt: no such file or directory
2022/03/13 18:19:11 [I] [control.go:181] [d72a10e8af15e80a] [devwiki_git_ssh] start proxy success
2022/03/13 18:19:11 [I] [control.go:181] [d72a10e8af15e80a] [devwiki_nginx] start proxy success
2022/03/13 18:19:11 [I] [control.go:181] [d72a10e8af15e80a] [devwiki_blog] start proxy success
2022/03/13 18:19:11 [I] [control.go:181] [d72a10e8af15e80a] [devwiki_nas] start proxy success
2022/03/13 18:19:11 [W] [control.go:179] [d72a10e8af15e80a] [devwiki_nas_https] start error: gen TLS config error: open ./ssl/nas.crt: no such file or directory
2022/03/13 18:19:11 [I] [control.go:181] [d72a10e8af15e80a] [devwiki_git] start proxy success

nas中 配置挂载点: image

不提示找不到 key, 提示找不到 crt, 尝试了直接放在 frp 根目录 也是不行.

image

配置https 证书, 提示无法找到文件, 使用windows系统测试 证书都正常.

C:\GreenSoft\frp_0.39.1_windows_386>frpc.exe -c frpc.ini
2022/03/13 18:19:36 [I] [service.go:327] [b8a1dae036e6c52c] login to server success, get run id [b8a1dae036e6c52c], server udp port [0]
2022/03/13 18:19:36 [I] [proxy_manager.go:144] [b8a1dae036e6c52c] proxy added: [devwiki_nas devwiki_nas_https]
2022/03/13 18:19:36 [I] [service.go:135] admin server listen on 127.0.0.1:7400
2022/03/13 18:19:36 [I] [control.go:181] [b8a1dae036e6c52c] [devwiki_nas] start proxy success
2022/03/13 18:19:36 [I] [control.go:181] [b8a1dae036e6c52c] [devwiki_nas_https] start proxy success
Dev-Wiki commented 2 years ago

威联通的系统可以在线体验 QNAP 在线体验 | QNAP https://www.qnap.com.cn/zh-cn/live-demo

stilleshan commented 2 years ago

贴frpc.ini 和容器配置

Dev-Wiki commented 2 years ago
[common]
server_addr = xxx
server_port = xxx
token= xxx

# Admin UI 
admin_addr = 127.0.0.1
admin_port = xxx
admin_user = xxx
admin_pwd = xxx

# TCP 多路复用 
tcp_mux = false

# 连接池上限
max_pool_count = 1

[devwiki_nas]
type = http
local_ip=127.0.0.1
local_port=80
custom_domains = nas.devwiki.net

[devwiki_nas_https]
type = https
custom_domains = nas.devwiki.net
plugin = https2http
plugin_local_addr = 127.0.0.1:80
# HTTPS 证书相关的配置
plugin_crt_path = ./ssl/nas.crt
plugin_key_path = ./ssl/nas.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp

配置, 容器配置 http 正常

image

image

Dev-Wiki commented 2 years ago
[common]
server_addr = xxx
server_port = xxx
token= xxx

# Admin UI 
admin_addr = 127.0.0.1
admin_port = xxx
admin_user = xxx
admin_pwd = xxx

# TCP 多路复用 
tcp_mux = false

# 连接池上限
max_pool_count = 1

[devwiki_nas]
type = http
local_ip=127.0.0.1
local_port=80
custom_domains = nas.devwiki.net

[devwiki_nas_https]
type = https
custom_domains = nas.devwiki.net
plugin = https2http
plugin_local_addr = 127.0.0.1:80
# HTTPS 证书相关的配置
plugin_crt_path = ./ssl/nas.crt
plugin_key_path = ./ssl/nas.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp

配置, 容器配置 http 正常

image

image

本地使用 windows系统按照上述配置是可以的, https 也正常

stilleshan commented 2 years ago

把证书挂在到容器里,在把 plugin_crt_path 和 plugin_key_path 的路径改为容器内的路径.

Dev-Wiki commented 2 years ago

把证书挂在到容器里,在把 plugin_crt_path 和 plugin_key_path 的路径改为容器内的路径.

增加 这两个路径 映射到 文件路径里面么?

Dev-Wiki commented 2 years ago

威联通的这个容器自己是没有存储路径的, 是需要映射本地的文件夹路径. 比如 nas盘的: /share/Container/container-station-data/application/frp, 对应为 frpc 的 /frpc 文件夹

stilleshan commented 2 years ago

那路径就是 /frp/ssl/nas.crt

Dev-Wiki commented 2 years ago

那路径就是 /frp/ssl/nas.crt

对对, 我就改成这样了, 可以了 谢谢, 我整理下, 使用你的镜像, 我写个教程文章

Dev-Wiki commented 2 years ago

这个可以关闭了

Dev-Wiki commented 2 years ago

这个可以关闭了