klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.53k stars 875 forks source link

Latest caddy 2.7.4 doens't work but returns error #568

Closed Chilledheart closed 11 months ago

Chilledheart commented 11 months ago

I tried something with latest caddy+forwardproxy build like:

➜  forwardproxy git:(naive) git fetch -p
fatal: unable to access 'https://github.com/klzgrad/forwardproxy/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

the log of caddy shows some error:

2023/09/19 07:59:17.007 ERROR   http.log.access.log0    handled request {"request": {"remote_ip": "127.0.0.1", "remote_port": "49844", "client_ip": "127.0.0.1", "proto": "HTTP/2.0", "method": "CONNECT", "host": "github.com:443", "uri": "github.com:443", "headers": {"Padding": ["*?\"*(?$;;?<\"+;@,XXXXXXX"], "Proxy-Authorization": []}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "example.com"}}, "bytes_read": 0, "user_id": "", "duration": 0.000065564, "size": 0, "status": 500, "resp_headers": {"Server": ["Caddy"], "Alt-Svc": ["h3=\":443\"; ma=2592000"]}}

Old caddy 2.6.4 works properly without error.

Tried both of tag (v2.7.4-caddy2-naive) with golang 1.18 and self-compiled one with golang 1.21.1, but no luck.

The caddyfile is simple, like:

{
  order forward_proxy before file_server
}
:443, example.com {
  log {
    output file /var/log/caddy.log {
      roll_disabled
    }
    format console
    level  INFO
  }
  tls noone@example.com
  route {
    forward_proxy {
      basic_auth username password
      hide_ip
      hide_via
      probe_resistance
    }
    file_server {
      browse
      root /path/to/directory
    }
  }
}
klzgrad commented 11 months ago

Duplicate of #550.