rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
8.8k stars 440 forks source link

ERROR rathole::server: Failed to do transport handshake #366

Open okxlin opened 3 weeks ago

okxlin commented 3 weeks ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. run create_self_signed_cert.sh create tls files
  2. docker run

Configuration

[client]
remote_addr = "1.2.3.4:40000"
#default_token = "xlswochestisw0xlwujifros6lfobu"

[client.transport]
#type = "tcp"
type = "tls"
[client.transport.tls]
trusted_root = "tls/rootCA.crt"
hostname = "localhost"

[client.services.my_nas_ssh]
token = "xlswochestisw0xlwujifros6lfobu"
local_addr = "127.0.0.1:40189"
[server]
bind_addr = "0.0.0.0:40000"
#default_token = "xlswochestisw0xlwujifros6lfobu"

[server.transport]
#type = "tcp"
type = "tls"
[server.transport.tls]
pkcs12 = "tls/identity.pfx"
pkcs12_password = "1234"

[server.services.my_nas_ssh]
token = "xlswochestisw0xlwujifros6lfobu"
bind_addr = "0.0.0.0:26000"
services:
  rathole:
    image: "rapiz1/rathole:latest"
    container_name: ${CONTAINER_NAME}
    restart: always
    network_mode: "host"
    volumes:
      - "${CONFIG_PATH}:/app/config.toml"
      - "./data/tls/:/app/tls/"
    command: --${SERVICE_MODE} /app/config.toml
    labels:
      createdBy: "Apps"

Logs

rathole  | 2024-06-06T09:29:14.123180Z ERROR rathole::server: Failed to do transport handshake: Connection reset by peer (os error 104): Connection reset by peer (os error 104)

Environment:

ChatGPT:

It looks like there was an error in the transport handshake of the "rathole" server due to a wrong version number in the SSL handshake. This could be caused by various factors such as incompatible SSL/TLS versions between the client and server or misconfiguration of SSL/TLS settings. Troubleshooting this would involve checking the SSL/TLS configuration on both the client and server side to ensure compatibility and correctness.