Closed Flynn2018 closed 2 years ago
I have the same problem, please answer
In answer to your questions -
In answer to your questions -
- The client is not capable of configuring any TLS parameters I know of, the TLS implementation is in the Dart runtime, see the secure sockets API for more information although I believe dart does support TLS v1.
- Again, the client does nothing here except pass the security context you supply it to the secure socket layer, see here for details on the security context API. It does allow you to negotiate ALPN protocols which your code above doesn't seem to be doing. I can't really comment on how you generate your certificate except it must conform to whatever requirements the security context API places on it.
Actually, I noticed the method setAlpnProtocols (List
After reading some document these days, it seems that the dart doesn't support self signed certificate. So cannot add the self signed certificate to the Flutter app local trust certificate store. Anyone has some suggestions?
After reading some document these days, it seems that the dart doesn't support self signed certificate. So cannot add the self signed certificate to the Flutter app local trust certificate store. Anyone has some suggestions?
I also encountered,flutter cannot add the self signed certificate to the flutter App Local Trust Certificate Store
Hello friends, I built an mqtt broker using mosquitto and work normally. The certificate configuration in mosquitto.conf is as follows:
# Port to use for the default listener.
port 8883
# At least one of cafile or capath must be defined. They both
# define methods of accessing the PEM encoded Certificate
# Authority certificates that have signed your server certificate
# and that you wish to trust.
# cafile defines the path to a file containing the CA certificates.
# capath defines a directory that will be searched for files
# containing the CA certificates. For capath to work correctly, the
# certificate files must have ".crt" as the file ending and you must run
# "c_rehash <path to capath>" each time you add/remove a certificate.
#capath
cafile /cert/ca.crt
# Path to the PEM encoded server certificate.
certfile /cert/server.crt
# Path to the PEM encoded keyfile.
keyfile /cert/server.key
# This option defines the version of the TLS protocol to use for this listener.
# The default value allows v1.2, v1.1 and v1.0, if they are all supported by
# the version of openssl that the broker was compiled against. For openssl >=
# 1.0.1 the valid values are tlsv1.2 tlsv1.1 and tlsv1. For openssl < 1.0.1 the
# valid values are tlsv1.
tls_version tlsv1
The steps to generate the certificate files used above are as follows:
openssl req -new -x509 -days 36500 -extensions v3_ca -keyout ca.key -out ca.crt
openssl genrsa -out server.key 2048
openssl req -out server.csr -key server.key -new
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 36500
Now I write and Flutter APP using https://pub.flutter-io.cn/packages/mqtt_client package (v9.6.6), and some key codes are as follows:
When invoking the await _client.connect();, I always get the 'UNSUPPORTED_PROTOCOL' error, so secure socket connect cannot get work:
Some questions here:
1.As the above mosquitto broker server using tlsv1, Can the package mqtt_client configure the supported TLS version?