我的服务器正在运行带有 Nginx 托管 PHP 代码(使用证书和工作)的 Ubuntu,并“代理”用 NodeJS 编写的应用程序服务器代码。它一直在工作,直到我更改为 HTTPS。
我的 POST 请求典型用法:
var jsonRequest = //Some JSON.
Map<String, String> headers = {'Content-type': 'application/json'};
var response = await http.post(urls['auth'], body: jsonRequest,headers: headers);
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
E/flutter (25875): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
E/flutter (25875): WRONG_VERSION_NUMBER(tls_record.cc:242))
E/flutter (25875): #0 IOClient.send (package:http/src/io_client.dart:33:23)
E/flutter (25875): <asynchronous suspension>
E/flutter (25875): #1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:169:38)
E/flutter (25875): <asynchronous suspension>
E/flutter (25875): #2 BaseClient.post (package:http/src/base_client.dart:54:7)
E/flutter (25875): #3 post.<anonymous closure> …Run Code Online (Sandbox Code Playgroud)