小编Roy*_*yBS的帖子

如何在Android Studio中设置SignalR以忽略用于开发的SSL问题

我有一个使用SignalR的网站.下面的代码(取自SignalR-Chat示例)通过其经过验证的SSL连接到生产站点.它使用来自SignalR/java-client的jar.

但是对于开发我需要连接到我的计算机上使用IIS Express和本地SSL托管的VS项目,我的Nexus不能也不应该验证,我收到以下错误:

08-17 16:13:55.540    2153-6860//System.out? HubConnection: Error executing request: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
08-17 16:13:55.541    2153-6859//System.err? java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Run Code Online (Sandbox Code Playgroud)

我已经在防火墙中打开了相关端口,我可以通过Rest请求到达IIS Express.

这是代码:

public class gtSockets {

    public static final String URL = myUrl + "/signalr/hubs/";

    HubConnection connection;
    HubProxy hub;

    DemonThread thread;

    private Context context;

    private static gtSockets gtSockets;

    private gtSockets(Context context) {
        this.context = context;

        initConnection();
    }

    public static gtSockets newInstance(Context context) {
        if(gtSockets == null) {
            gtSockets …
Run Code Online (Sandbox Code Playgroud)

ssl android ssl-certificate signalr android-studio

4
推荐指数
1
解决办法
2652
查看次数

标签 统计

android ×1

android-studio ×1

signalr ×1

ssl ×1

ssl-certificate ×1