The following exception:
SocketIOException: Unexpected handshake error in client (OS Error: errno = -12268) #0 _SecureFilterImpl.handshake (dart:io-patch:849:8) #1 _SecureSocket._secureHandshake (dart:io:7382:28) #2 _SecureSocket._secureConnectHandler._secureConnectHandler (dart:io:7294:21) #3 _Socket._updateOutHandler.firstWriteHandler (dart:io-patch:773:64) #4 _SocketBase._multiplex (dart:io-patch:408:26) #5 _SocketBase._sendToEventHandler.<anonymous closure> (dart:io-patch:509:20) #6 _ReceivePortImpl._handleMessage (dart:isolate-patch:37:92)
obtained from the following code:
String url = "https://www.google.com"; HttpClient client = new HttpClient(); HttpClientConnection conn = client.getUrl(new Uri(url)); conn.onResponse = (HttpClientResponse resp) { print ('content length ${resp.contentLength}'); print ('status code ${resp.statusCode}'); InputStream input = resp.inputStream; input.onData = () { print(codepointsToString(input.read())); }; input.onClosed = () { print('closed!'); client.shutdown(); }; };
Please note that if I replace the URL with βhttpβ instead of βhttpsβ, it works as expected.
Error report here.
source share