-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
set up ssl cause throwing NoSuchAlgorithmException: KeyStore JKS implementation not found #1410
Comments
Android only supports BKS as far as I remember |
i changed the keystore to bks and edit code as
now the exception i talked about in previous post is solved but i cannot connect to server yet . it fails . |
See https://github.com/TooTallNate/Java-WebSocket/wiki/Getting-a-SSLContext-from-different-sources#getting-a-sslcontext-using-a-keystore-on-android for an android example. Apart from this, I dont think we can help you much here. |
i figured it out . 1/ Install OpenSSL 2/Generate a Private Key Use OpenSSL to generate a private key 3/ Create a Certificate Signing Request (CSR)
4/ Generate a Self-Signed Certificate
5/ Convert the Certificate to the Appropriate Format android supports bks . first you should convert the certificate to PKCS#12 format with the extension .p12 or .pfx then to bks .
6/ put the bks file format in your android project . i put it in my assets . 7/ set up ssl in your code : ` init {
following these steps eventually resulted in connecting with wss. |
my android app is going to be a server which allows a web to connect to it as a client . i have a SocketServerManger which handle the task properly when i connect to my android device via ws connection . but i want my clients can connect to the android device server with wss connection .
here is my manager :
`class SocketServerManger(port: Int, val socketListener: List, context: Context) :
WebSocketServer(InetSocketAddress(port)) {
}`
i add the below code to set up ssl/tls:
` init {
createSSLContext(context)?.let {
setWebSocketFactory(DefaultSSLWebSocketServerFactory(it))
}
`
but it keeps throwing the exception:
Caused by: java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found
it throw it on this line :
val keyStore = KeyStore.getInstance("JKS")
The text was updated successfully, but these errors were encountered: