[GH-ISSUE #2250] plugin_https2http: error: failed to parse private key #1790

Closed
opened 2026-05-05 13:09:26 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @Arimov on GitHub (Feb 20, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2250

Originally assigned to: @yuyulei on GitHub.

Version: 0.35.1
Server:
OS: Debian GNU/Linux 9 (stretch)
CPU architecture: Amd64

Client:
OS: Raspbian GNU/Linux 10 (buster)
CPU: Arm

I'm trying to run in mode https2http
My server ini:

[common]
bind_port = 7007
vhost_http_port = 8585
vhost_https_port = 4433

my client ini:

[common]
server_addr = 88.99.1.1
server_port = 7007

[plugin_https2http]
type = https
custom_domains = mydomain.com

plugin = https2http
plugin_local_addr = 127.0.0.1:8123
plugin_crt_path = ./server.crt
plugin_key_path = ./server.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp

On the client I created keys:
$ openssl genrsa -des3 -out server.key 2048
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -signkey server.key -in server.csr -req -days 9965 -out server.crt
and put it in home catalog

I start server - ok
$ sudo /usr/bin/frps -c /etc/frp/frps.ini

I start client:
$ sudo /usr/bin/frpc -c /etc/frp/frpc.ini

and get error:
[W] [control.go:178] [7193986e54985d09] [plugin_https2http] start error: gen TLS config error: tls: failed to parse private key

Originally created by @Arimov on GitHub (Feb 20, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2250 Originally assigned to: @yuyulei on GitHub. Version: 0.35.1 Server: OS: Debian GNU/Linux 9 (stretch) CPU architecture: Amd64 Client: OS: Raspbian GNU/Linux 10 (buster) CPU: Arm I'm trying to run in mode https2http My server ini: ``` [common] bind_port = 7007 vhost_http_port = 8585 vhost_https_port = 4433 ``` my client ini: ``` [common] server_addr = 88.99.1.1 server_port = 7007 [plugin_https2http] type = https custom_domains = mydomain.com plugin = https2http plugin_local_addr = 127.0.0.1:8123 plugin_crt_path = ./server.crt plugin_key_path = ./server.key plugin_host_header_rewrite = 127.0.0.1 plugin_header_X-From-Where = frp ``` On the client I created keys: `$ openssl genrsa -des3 -out server.key 2048` `$ openssl req -new -key server.key -out server.csr` `$ openssl x509 -signkey server.key -in server.csr -req -days 9965 -out server.crt` and put it in home catalog I start server - ok `$ sudo /usr/bin/frps -c /etc/frp/frps.ini` I start client: `$ sudo /usr/bin/frpc -c /etc/frp/frpc.ini` and get error: `[W] [control.go:178] [7193986e54985d09] [plugin_https2http] start error: gen TLS config error: tls: failed to parse private key`
gitea-mirror 2026-05-05 13:09:26 -06:00
Author
Owner

@yuyulei commented on GitHub (Feb 22, 2021):

@Arimov maybe similar to https://github.com/stellar/go/issues/64 or https://github.com/Coccodrillo/apns/issues/34, and I recommend the example: https://github.com/fatedier/frp/pull/2251/files

<!-- gh-comment-id:783102180 --> @yuyulei commented on GitHub (Feb 22, 2021): @Arimov maybe similar to https://github.com/stellar/go/issues/64 or https://github.com/Coccodrillo/apns/issues/34, and I recommend the example: https://github.com/fatedier/frp/pull/2251/files
Author
Owner

@Arimov commented on GitHub (Feb 27, 2021):

I redid the certificate according to this instruction and now I do not receive an error on the client

$ openssl genrsa -des3 -out server.key 2048
$ openssl rsa -in server.key -out server.key.insecure
$ mv server.key server.key.secure
$ mv server.key.insecure server.key
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
$ sudo cp server.crt /etc/ssl/certs
$ sudo cp server.key /etc/ssl/private

And it works for me (what if it comes in handy)

<!-- gh-comment-id:787128158 --> @Arimov commented on GitHub (Feb 27, 2021): I redid the certificate according to this instruction and now I do not receive an error on the client ``` $ openssl genrsa -des3 -out server.key 2048 $ openssl rsa -in server.key -out server.key.insecure $ mv server.key server.key.secure $ mv server.key.insecure server.key $ openssl req -new -key server.key -out server.csr $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt $ sudo cp server.crt /etc/ssl/certs $ sudo cp server.key /etc/ssl/private ``` And it works for me (what if it comes in handy)
Author
Owner

@haade-administrator commented on GitHub (Mar 2, 2021):

hello arimov i created a hassio-addons frp module,https://github.com/haade-administrator/haade-addons as i see you are using homeassistant could you give me the whole frps server and frpc client manipulation so that i see how to integrate ssl into the module with openssl, thanks for advanced

<!-- gh-comment-id:788977192 --> @haade-administrator commented on GitHub (Mar 2, 2021): hello arimov i created a hassio-addons frp module,[https://github.com/haade-administrator/haade-addons](https://github.com/haade-administrator/haade-addons) as i see you are using homeassistant could you give me the whole frps server and frpc client manipulation so that i see how to integrate ssl into the module with openssl, thanks for advanced
Author
Owner

@Arimov commented on GitHub (Mar 2, 2021):

hi @haade-administrator, I took a free certificate from CloudFlare. The server code worked for me, but the websockets still didn't work :-(
In the end, I decided to proxy through another web server (nginx and Let's encrypt)

<!-- gh-comment-id:789019628 --> @Arimov commented on GitHub (Mar 2, 2021): hi @haade-administrator, I took a free certificate from CloudFlare. The server code worked for me, but the websockets still didn't work :-( In the end, I decided to proxy through another web server (nginx and Let's encrypt)
Author
Owner

@github-actions[bot] commented on GitHub (Apr 17, 2021):

Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.

<!-- gh-comment-id:821736116 --> @github-actions[bot] commented on GitHub (Apr 17, 2021): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
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#1790
No description provided.