Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING ssl_accept: bad SSL client, reason=155, error_string=https proxy request #4021

Closed
exbit opened this issue Jan 23, 2021 · 1 comment
Closed
Labels

Comments

@exbit
Copy link

exbit commented Jan 23, 2021

Good afternoon, I start the https proxy server, enter the address 127.0.0.1:9501 as a proxy for the browser, in the browser I get an error:
"This site can't be reachedThe webpage at https://github.com/ might be temporarily down or it may have moved permanently to a new web address. ERR_TUNNEL_CONNECTION_FAILED"
on server:
"WARNING ssl_accept: bad SSL client [127.0.0.1:3049], reason = 155, error_string = https proxy request"

If I run an http proxy server, everything works fine
If I run an https web server, everything works fine.

  1. What did you do? If possible, provide a simple script for reproducing the error.
$http = new Server('127.0.0.1', 9501, SWOOLE_PROCESS, SWOOLE_SOCK_TCP | SWOOLE_SSL);
$http->set([
    'ssl_cert_file' => 'fullchain1.pem',
    'ssl_key_file' => 'privkey1.pem',
    'log_level' => \SWOOLE_LOG_DEBUG,
]);

$http->on('connect', function ($server, $fd) {
    echo "New connection established: #{$fd}.\n";
});

$http->on('request', function ($request, $response) {
    $response->end(client($request->header['host'], $request->server['request_uri']));
});

$http->start();

function client($host, $get) {
    $cli = new Client($host, 443, true);
    $cli->get($get);
    $cli->close();

    return $cli->body;
}
  1. What did you expect to see?

[2021-01-24 01:29:44 #7984.1] WARNING ssl_accept: bad SSL client[127.0.0.1:3049], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.3] WARNING ssl_accept: bad SSL client[127.0.0.1:3052], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.2] WARNING ssl_accept: bad SSL client[127.0.0.1:3051], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.1] WARNING ssl_accept: bad SSL client[127.0.0.1:3050], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.5] WARNING ssl_accept: bad SSL client[127.0.0.1:3054], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.4] WARNING ssl_accept: bad SSL client[127.0.0.1:3053], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.1] WARNING ssl_accept: bad SSL client[127.0.0.1:3055], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.2] WARNING ssl_accept: bad SSL client[127.0.0.1:3057], reason=155, error_string=https proxy request
[2021-01-24 01:29:44 #7984.1] WARNING ssl_accept: bad SSL client[127.0.0.1:3056], reason=155, error_string=https proxy request

  1. What did you see instead?
    New connection established: add swoole_version function to show swolle version in php code #9.

  2. What version of Swoole are you using (show your php --ri swoole)?
    php --ri swoole
    swoole

Swoole => enabled
Author => Swoole Team team@swoole.com
Version => 4.6.1
Built => Jan 17 2021 15:20:14
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1i 8 Dec 2020
dtls => enabled
http2 => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
    Linux Home 4.4.0-19041-Microsoft 1.8.0 beta在php-7.0.2测试错误 #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 GNU/LinuxUsing built-in specs.

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

@matyhtf
Copy link
Member

matyhtf commented Jan 26, 2021

The client may not be connected via ssl, Please use tcpdump or strace to track the execution of the program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants