ssl: improve fallback to plaintext (untranslated txt)

ssl
Georg Lukas 2013-04-04 21:51:00 +02:00
rodzic 0fd5af75a0
commit 6f0227359e
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -93,17 +93,20 @@ class TcpUploader(service : AprsService, prefs : PrefsWrapper) extends AprsBacke
}
}
kmf.init(ks, KEYSTORE_PASS)
val sc = SSLContext.getInstance("TLS")
sc.init(kmf.getKeyManagers(), Array(new NaiveTrustManager()), null)
val socket = sc.getSocketFactory().createSocket(host, port).asInstanceOf[SSLSocket]
socket
} catch {
case e : java.io.FileNotFoundException =>
service.postAddPost(StorageDatabase.Post.TYPE_INFO, R.string.post_info,
"No keyfile for '%s'! Using plaintext.".format(prefs.getCallsign()))
return null
case e : Exception =>
e.printStackTrace()
service.postAddPost(StorageDatabase.Post.TYPE_INFO, R.string.post_info, e.toString())
return null
}
val sc = SSLContext.getInstance("TLS")
sc.init(kmf.getKeyManagers(), Array(new NaiveTrustManager()), null)
val socket = sc.getSocketFactory().createSocket(host, port).asInstanceOf[SSLSocket]
socket
}
def init_socket() {