Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Android中的WebSite连接到WSS_Android_Ssl_Websocket_Socat_Self Signed Certificate - Fatal编程技术网

使用Android中的WebSite连接到WSS

使用Android中的WebSite连接到WSS,android,ssl,websocket,socat,self-signed-certificate,Android,Ssl,Websocket,Socat,Self Signed Certificate,我需要连接到一个WSS服务器,该服务器使用来自带有WebSocate的Android设备的自签名证书 websitewss://example.com适用于与权威机构签署的ceriticates,但无法验证自签名证书 除了WebSite之外,还有一个使用socat的解决方案: website--binary--ws-c-uri=wss://example.com -ws-c:cmd:'socat-ssl:example.com:443,verify=1,cafile=/path/to/cert.

我需要连接到一个WSS服务器,该服务器使用来自带有WebSocate的Android设备的自签名证书

websitewss://example.com
适用于与权威机构签署的ceriticates,但无法验证自签名证书

除了WebSite之外,还有一个使用socat的解决方案:

website--binary--ws-c-uri=wss://example.com -ws-c:cmd:'socat-ssl:example.com:443,verify=1,cafile=/path/to/cert.crt'

这在Debian中有效,但在Android中不起作用,因为Android的socat不支持SSL(我不确定是否有一种可行的方法可以编译支持Android SSL的socat)


是否可以让WebSocate使用自签名证书?

已经有了支持
-k
-unsecure
)选项的
WebSocate 1.2.0
,该选项与curl中的选项类似,可以关闭证书验证

此外,我还提供了适用于Android的静态ish
openssl
可执行文件,它也可以用作WebSocate 1.1.0中的一种变通方法:

$ websocat -b --ws-c-uri=wss://echo.websocket.org - ws-c:sh-c:'openssl s_client -quiet -connect echo.websocket.org:443'
depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
verify return:1
depth=0 CN = *.websocket.org
verify return:1
dsaf
dsaf
12345
12345