Skip to content

SSL Proxy with a HttpClient? #43876

Open
Open
@hacker1024

Description

The docs describe how to set up a HttpClient that uses a proxy by setting the findProxy callback.

This works fine with HTTP proxies, but not when using a proxy with SSL.

When using a SSL server (for example, us5308.nordvpn.com:89), a get operation fails with the following:

Unhandled exception:
Connection closed before full header was received
#0      IOClient.send (package:http/src/io_client.dart:62:7)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:91:38)
#2      BaseClient.get (package:http/src/base_client.dart:27:7)
#3      main (<DART_FILE>)
<asynchronous suspension>
#4      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

The same server can be connected to with no problems with OpenSSL:

$ openssl s_client -connect us5308.nordvpn.com:89

A low level connection with the dart:io SecureSocket API also works.

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-io

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions