Android 在本地Expo应用程序中,使用Feathers.js SocketIO发布连接到SSL自签名证书

Android 在本地Expo应用程序中,使用Feathers.js SocketIO发布连接到SSL自签名证书,android,react-native,socket.io,expo,feathersjs,Android,React Native,Socket.io,Expo,Feathersjs,我有一个用Expo构建的React本机应用程序,我已经从Expo中分离出来,以便编写一些Android本机代码-它使用Feathers.js SocketIO进行连接,这在HTTP中可以正常工作,但是当使用HTTPS自签名证书时,我收到一个套接字连接超时错误 套接字连接超时 堆栈跟踪: node_modules/@feathersjs/authentication client/lib/passport.js:120:25 在 node_modules/react native/Librarie

我有一个用Expo构建的React本机应用程序,我已经从Expo中分离出来,以便编写一些Android本机代码-它使用Feathers.js SocketIO进行连接,这在HTTP中可以正常工作,但是当使用HTTPS自签名证书时,我收到一个套接字连接超时错误

套接字连接超时

堆栈跟踪:
node_modules/@feathersjs/authentication client/lib/passport.js:120:25 在
node_modules/react native/Libraries/Core/Timers/JSTimers.js:152:14 in _callTimer节点_modules/react native/Libraries/Core/Timers/JSTimers.js:405:17 in 呼叫计时器
node_modules/react native/Libraries/BatchedBridge/MessageQueue.js:349:47 在调用函数中
node_modules/react native/Libraries/BatchedBridge/MessageQueue.js:106:26 在
node_modules/react native/Libraries/BatchedBridge/MessageQueue.js:297:10 在\uuuu防护装置中
node_modules/react native/Libraries/BatchedBridge/MessageQueue.js:105:17 在callFunctionReturnFlushedQueue中

在React本机代码中,我建立了如下连接:

const options = {
  transports: ['websocket'],
  forceNew: true,
  rejectUnauthorized: false,
  verify: false,
  secure: true
};

const MOBILE_SERVER_IP = 'https://mypublicIP:3030';

const socket = io(MOBILE_SERVER_IP, options);

// Initilize the feathersClient object
const feathersClient = feathers()
  .configure(socketio(socket))
  .configure(
    auth({
      storage: AsyncStorage,
      timeout: 60000
    })
  );
在从Android Studio构建应用程序以在我的Android设备上进行测试时,Expo在React本机端运行,之前我收到了证书链信任错误,直到我将以下代码添加到我的AndroidManifest.xml文件中:

  <application
    android:networkSecurityConfig="@xml/network_security_config"

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
        <trust-anchors>
            <certificates src="@raw/cert"/>
            <certificates src="system"/>
        </trust-anchors>
    </base-config>
</network-security-config>