Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ssl:// scheme,return password or username error #477

Open
woaimi520 opened this issue Jun 18, 2022 · 0 comments
Open

use ssl:// scheme,return password or username error #477

woaimi520 opened this issue Jun 18, 2022 · 0 comments

Comments

@woaimi520
Copy link

    my  mqttConnectOptions setting , we just use ssl,
mqttConnectOptions?.apply {
            isCleanSession = false   //是否清除缓存
            isAutomaticReconnect = false//是否重连
            keepAliveInterval = 20 //,MQTT 协议中约定:在 1.5*Keep Alive 的时间间隔内,如果 Broker 没有收到来自 Client 的任何数据包,那么 Broker 认为它和 Client 之间的连接已经断开;同样地, 如果 Client 没有收到来自 Broker 的任何数据包,那么 Client 认为它和 Broker 之间的连接已经断开
            userName = clientUsername //登陆的名字
            password = clientPassword.toCharArray() //登陆的密码
            connectionTimeout = 10//超时时间
//            mqttVersion  = MqttConnectOptions.MQTT_VERSION_3_1_1
//            val mySslProperties = Properties()
//            mySslProperties.put(SSLSocketFactoryFactory.TRUSTSTOREPWD, true)
//            mySslProperties.put(SSLSocketFactoryFactory.CLIENTAUTH, false)
//            sslProperties = mySslProperties
//            socketFactory = MySocketFactory.getSocketFactory(context.resources.openRawResource(R.raw.ca),context.resources.openRawResource(R.raw.cer),context.resources.openRawResource(R.raw.key))
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant