[GH-ISSUE #1500] 局域网内机器自带https服务(非公开认证的ssl证书),frp该怎么配置? #1185

Closed
opened 2026-05-05 12:45:43 -06:00 by gitea-mirror · 21 comments
Owner

Originally created by @at2008 on GitHub (Nov 6, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1500

使用场景:

局域网电脑部署了Cockpit(一个基于WEB的Linux运维管理工具),在外网通过Cockpit管理局域网的电脑,Cockpit自带https协议,我该怎么配置 frp 才能正常打开Cockpit管理界面呢?

现在 frp 支持的 是https2http,我现在遇到的情况似乎是 http2https 或者 https2https。

现在的问题:

通过配置 frp ,可以在外网打开 Cockpit 登录页面,登陆后就变白屏了,没什么信息显示。

参考信息:

之前用过 花生壳 ,花生壳需要配置一个独立的端口,就通过https从公网访问局域网内https的web应用,不知道花生壳是怎么做的。

What version of frp are you using (./frpc -v or ./frps -v)?

v0.29.1

What operating system and processor architecture are you using (go env)?

ubuntu 18/16

Configures you used:

==============frps=============

frps.ini

[common]
bind_port = 11001
kcp_bind_port = 11001
vhost_http_port = 80
vhost_https_port = 443

==============frpc=============

frpc.ini

[common]
server_addr = x.x.x.x
server_port = 11001
protocol = kcp

[hos-http-m.mydomain.cn]
type = http
local_port = 9090
custom_domains = m.mydomain.cn

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

通过配置 frp ,可以在外网打开 Cockpit 登录页面,登陆后就变白屏了,没什么信息显示。

Describe the results you expected:

希望,通过 frp 能够连接内网已经是https的web应用。

Additional information you deem important (e.g. issue happens only occasionally):
之前用过 花生壳 ,花生壳需要配置一个独立的端口,就通过https从公网访问局域网内https的web应用,不知道花生壳是怎么做的。

Can you point out what caused this issue (optional)

Originally created by @at2008 on GitHub (Nov 6, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1500 ## 使用场景: 局域网电脑部署了Cockpit(一个基于WEB的Linux运维管理工具),在外网通过Cockpit管理局域网的电脑,Cockpit自带https协议,我该怎么配置 frp 才能正常打开Cockpit管理界面呢? 现在 frp 支持的 是https2http,我现在遇到的情况似乎是 http2https 或者 https2https。 ## 现在的问题: 通过配置 frp ,可以在外网打开 Cockpit 登录页面,登陆后就变白屏了,没什么信息显示。 ## 参考信息: 之前用过 花生壳 ,花生壳需要配置一个独立的端口,就通过https从公网访问局域网内https的web应用,不知道花生壳是怎么做的。 **What version of frp are you using (./frpc -v or ./frps -v)?** v0.29.1 **What operating system and processor architecture are you using (`go env`)?** ubuntu 18/16 **Configures you used:** ==============frps============= # frps.ini [common] bind_port = 11001 kcp_bind_port = 11001 vhost_http_port = 80 vhost_https_port = 443 ==============frpc============= # frpc.ini [common] server_addr = x.x.x.x server_port = 11001 protocol = kcp [hos-http-m.mydomain.cn] type = http local_port = 9090 custom_domains = m.mydomain.cn **Steps to reproduce the issue:** 1. 2. 3. **Describe the results you received:** 通过配置 frp ,可以在外网打开 Cockpit 登录页面,登陆后就变白屏了,没什么信息显示。 **Describe the results you expected:** 希望,通过 frp 能够连接内网已经是https的web应用。 **Additional information you deem important (e.g. issue happens only occasionally):** 之前用过 花生壳 ,花生壳需要配置一个独立的端口,就通过https从公网访问局域网内https的web应用,不知道花生壳是怎么做的。 **Can you point out what caused this issue (optional)**
gitea-mirror 2026-05-05 12:45:43 -06:00
  • closed this issue
  • added the
    todo
    label
Author
Owner

@fatedier commented on GitHub (Nov 7, 2019):

type = http 改成 type = https。

<!-- gh-comment-id:550598832 --> @fatedier commented on GitHub (Nov 7, 2019): type = http 改成 type = https。
Author
Owner

@at2008 commented on GitHub (Nov 7, 2019):

type = http 改成 type = https。

大佬,问题依旧

我可能没说清楚,局域网电脑是 https ,公网是 http ,是不是这种方式不可以?

<!-- gh-comment-id:550679906 --> @at2008 commented on GitHub (Nov 7, 2019): > type = http 改成 type = https。 大佬,问题依旧 我可能没说清楚,局域网电脑是 https ,公网是 http ,是不是这种方式不可以?
Author
Owner

@fatedier commented on GitHub (Nov 7, 2019):

@at2008 目前不支持,可以考虑在你的 https 所在机器上再部署一个 nginx,通过配置 nginx 可以做这一层转换,再将转换过后的端口通过 http 暴露出来。

<!-- gh-comment-id:550688102 --> @fatedier commented on GitHub (Nov 7, 2019): @at2008 目前不支持,可以考虑在你的 https 所在机器上再部署一个 nginx,通过配置 nginx 可以做这一层转换,再将转换过后的端口通过 http 暴露出来。
Author
Owner

@fatedier commented on GitHub (Nov 7, 2019):

后面也可以考虑一下这个场景吧,可能对调试内部 https 服务有点帮助。

<!-- gh-comment-id:550690919 --> @fatedier commented on GitHub (Nov 7, 2019): 后面也可以考虑一下这个场景吧,可能对调试内部 https 服务有点帮助。
Author
Owner

@at2008 commented on GitHub (Nov 7, 2019):

后面也可以考虑一下这个场景吧,可能对调试内部 https 服务有点帮助。

多谢回复。

<!-- gh-comment-id:550741955 --> @at2008 commented on GitHub (Nov 7, 2019): > 后面也可以考虑一下这个场景吧,可能对调试内部 https 服务有点帮助。 多谢回复。
Author
Owner

@fatedier commented on GitHub (Nov 28, 2019):

v0.30.0 已新增 https2http plugin。

<!-- gh-comment-id:559359842 --> @fatedier commented on GitHub (Nov 28, 2019): v0.30.0 已新增 https2http plugin。
Author
Owner

@at2008 commented on GitHub (Nov 28, 2019):

@fatedier 感谢!马上测试!

<!-- gh-comment-id:559360128 --> @at2008 commented on GitHub (Nov 28, 2019): @fatedier 感谢!马上测试!
Author
Owner

@at2008 commented on GitHub (Nov 29, 2019):

@fatedier 请问
是 https2http 还是 http2https?
具体如何配置呢?

<!-- gh-comment-id:559643201 --> @at2008 commented on GitHub (Nov 29, 2019): @fatedier 请问 是 https2http 还是 http2https? 具体如何配置呢?
Author
Owner

@fatedier commented on GitHub (Nov 29, 2019):

https://github.com/fatedier/frp/blob/master/conf/frpc_full.ini#L210
参考这里的配置,上面说错了,是 http2https。

<!-- gh-comment-id:559643533 --> @fatedier commented on GitHub (Nov 29, 2019): https://github.com/fatedier/frp/blob/master/conf/frpc_full.ini#L210 参考这里的配置,上面说错了,是 http2https。
Author
Owner

@at2008 commented on GitHub (Nov 29, 2019):

@fatedier 反馈一下,我用的一个开源运维管理软件 Cockpit,错误提示:
Nov 28 19:13:12 CHI-KVM cockpit-tls[1759]: cockpit-tls: gnutls_handshake failed: The TLS connection was non-properly terminated.

<!-- gh-comment-id:559648496 --> @at2008 commented on GitHub (Nov 29, 2019): @fatedier 反馈一下,我用的一个开源运维管理软件 Cockpit,错误提示: Nov 28 19:13:12 CHI-KVM cockpit-tls[1759]: cockpit-tls: gnutls_handshake failed: The TLS connection was non-properly terminated.
Author
Owner

@fatedier commented on GitHub (Nov 29, 2019):

贴下 frpc 日志,另外确认下你的软件能够支持的 TLS 的 version。

<!-- gh-comment-id:559651171 --> @fatedier commented on GitHub (Nov 29, 2019): 贴下 frpc 日志,另外确认下你的软件能够支持的 TLS 的 version。
Author
Owner

@at2008 commented on GitHub (Nov 29, 2019):

@fatedier

Nov 29 03:32:19 CHI-KVM frpc[9845]: 2019/11/29 03:32:19 Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=
Nov 29 03:47:15 CHI-KVM frpc[9845]: 2019/11/29 03:47:15 Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=

<!-- gh-comment-id:559651960 --> @at2008 commented on GitHub (Nov 29, 2019): @fatedier Nov 29 03:32:19 CHI-KVM frpc[9845]: 2019/11/29 03:32:19 Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=<nil> Nov 29 03:47:15 CHI-KVM frpc[9845]: 2019/11/29 03:47:15 Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=<nil>
Author
Owner

@at2008 commented on GitHub (Nov 29, 2019):

@fatedier 支持的 TLS version
Cockpit supports TLS v. 1.1 and 1.2 by default

<!-- gh-comment-id:559817893 --> @at2008 commented on GitHub (Nov 29, 2019): @fatedier 支持的 TLS version Cockpit supports TLS v. 1.1 and 1.2 by default
Author
Owner

@fatedier commented on GitHub (Dec 1, 2019):

你用 curl 直接请求你的服务,可以得到正常的响应结果吗?

<!-- gh-comment-id:560045548 --> @fatedier commented on GitHub (Dec 1, 2019): 你用 curl 直接请求你的服务,可以得到正常的响应结果吗?
Author
Owner

@at2008 commented on GitHub (Dec 1, 2019):

20191201175320

我不知道你指的是这个吗?

<!-- gh-comment-id:560084720 --> @at2008 commented on GitHub (Dec 1, 2019): ![20191201175320](https://user-images.githubusercontent.com/25857125/69912380-8d1c9580-1463-11ea-86fc-79c5b834072d.png) 我不知道你指的是这个吗?
Author
Owner

@fatedier commented on GitHub (Dec 1, 2019):

加上 -k , curl -k https://xxx

<!-- gh-comment-id:560093041 --> @fatedier commented on GitHub (Dec 1, 2019): 加上 -k , curl -k https://xxx
Author
Owner

@at2008 commented on GitHub (Dec 1, 2019):

20191201214137

忘记报告一个要点了,通过 frp 登录页面时可以正常打开的,输入登录信息后不能正常进入系统,这个情况不知道怎么怎么测试。上面图时登录页信息,时正常的。

如果可以的的话,大佬自己装个 Cockpit 试试,如果不方便,这个需求应该不普遍的,可暂缓,不要影响主要功能进度。谢谢大佬回复!

<!-- gh-comment-id:560110102 --> @at2008 commented on GitHub (Dec 1, 2019): ![20191201214137](https://user-images.githubusercontent.com/25857125/69914806-6b330b00-1483-11ea-9463-780a1e8d7bd9.png) 忘记报告一个要点了,通过 frp 登录页面时可以正常打开的,输入登录信息后不能正常进入系统,这个情况不知道怎么怎么测试。上面图时登录页信息,时正常的。 如果可以的的话,大佬自己装个 Cockpit 试试,如果不方便,这个需求应该不普遍的,可暂缓,不要影响主要功能进度。谢谢大佬回复!
Author
Owner

@maxmib commented on GitHub (Feb 26, 2020):

反向https2http也有这个问题,内网是homeassistant http,用frp转换成https外网可以打开登陆页但是登陆不了,一直加载数据,用tcp模式则正常

<!-- gh-comment-id:591534392 --> @maxmib commented on GitHub (Feb 26, 2020): 反向https2http也有这个问题,内网是homeassistant http,用frp转换成https外网可以打开登陆页但是登陆不了,一直加载数据,用tcp模式则正常
Author
Owner

@fatedier commented on GitHub (Feb 26, 2020):

有可能是你的网站页面内的链接地址的原因,比如都是 http 的,frp 并不会修改网站中的内容,所以可能的情况就是首页虽然以 https 暴露出去了,但是点击其他链接的时候,还是会访问到 http 的服务,导致访问失败。

<!-- gh-comment-id:591558472 --> @fatedier commented on GitHub (Feb 26, 2020): 有可能是你的网站页面内的链接地址的原因,比如都是 http 的,frp 并不会修改网站中的内容,所以可能的情况就是首页虽然以 https 暴露出去了,但是点击其他链接的时候,还是会访问到 http 的服务,导致访问失败。
Author
Owner

@yzlnew commented on GitHub (Jun 14, 2022):

反向https2http也有这个问题,内网是homeassistant http,用frp转换成https外网可以打开登陆页但是登陆不了,一直加载数据,用tcp模式则正常

也遇到这个问题,最后有解决吗

<!-- gh-comment-id:1154629253 --> @yzlnew commented on GitHub (Jun 14, 2022): > 反向https2http也有这个问题,内网是homeassistant http,用frp转换成https外网可以打开登陆页但是登陆不了,一直加载数据,用tcp模式则正常 也遇到这个问题,最后有解决吗
Author
Owner

@YumeAyai commented on GitHub (Aug 24, 2022):

解决了吗

<!-- gh-comment-id:1225518776 --> @YumeAyai commented on GitHub (Aug 24, 2022): 解决了吗
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1185
No description provided.