You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I try to create https web sever in android app.
I found below code for makeSecure connection but it doesn't work. val keystore =KeyStore.getInstance(KeyStore.getDefaultType()) val keystoreStream: InputStream = assets.open("keySSS.jks") if (keystoreStream == null) { throw IOException("Unable to load keystore from classpath: " + "keystore.bks") } keystore.load(keystoreStream, "password".toCharArray()) val keyManagerFactory:KeyManagerFactory =KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()) keyManagerFactory.init(keystore, "password".toCharArray()) val server = AndroidWebServer(this) server.makeSecure(NanoHTTPD.makeSSLSocketFactory(keystore, keyManagerFactory), null) server.start(6000)
I generate sign key by below command: keytool -genkey -keyalg RSA -alias selfsigned -keystore keySSS.jks -storepass password -validity 9999 -keysize 2048 -ext SAN=DNS:localhost,IP:127.0.0.1 -validity 9999
And convert it to bks format with KeyStore Explorer Sofware.
But when i open the IP in browser, browser show below warning: Your connection to this site is not secure
can anyone say me what's wrong?
The text was updated successfully, but these errors were encountered:
The reason you are seeing that error message is because you are using a self-signed certificate. If you want that error message to go away, you need to use a certificate from a certificate authority like Lets Encrypt.
Hi
I try to create https web sever in android app.
I found below code for makeSecure connection but it doesn't work.
val keystore =KeyStore.getInstance(KeyStore.getDefaultType()) val keystoreStream: InputStream = assets.open("keySSS.jks") if (keystoreStream == null) { throw IOException("Unable to load keystore from classpath: " + "keystore.bks") } keystore.load(keystoreStream, "password".toCharArray()) val keyManagerFactory:KeyManagerFactory =KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()) keyManagerFactory.init(keystore, "password".toCharArray()) val server = AndroidWebServer(this) server.makeSecure(NanoHTTPD.makeSSLSocketFactory(keystore, keyManagerFactory), null) server.start(6000)
I generate sign key by below command:
keytool -genkey -keyalg RSA -alias selfsigned -keystore keySSS.jks -storepass password -validity 9999 -keysize 2048 -ext SAN=DNS:localhost,IP:127.0.0.1 -validity 9999
And convert it to bks format with KeyStore Explorer Sofware.
But when i open the IP in browser, browser show below warning:
Your connection to this site is not secure
can anyone say me what's wrong?
The text was updated successfully, but these errors were encountered: