mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 12:08:17 +00:00
Try to fix "No SSL cert found bind exception"
This commit is contained in:
parent
fd1890b072
commit
8f81195336
@ -177,10 +177,20 @@ public final class DispatchServer {
|
|||||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||||
try (FileInputStream fis = new FileInputStream(Grasscutter.getConfig().getDispatchOptions().KeystorePath)) {
|
try (FileInputStream fis = new FileInputStream(Grasscutter.getConfig().getDispatchOptions().KeystorePath)) {
|
||||||
char[] keystorePassword = Grasscutter.getConfig().getDispatchOptions().KeystorePassword.toCharArray();
|
char[] keystorePassword = Grasscutter.getConfig().getDispatchOptions().KeystorePassword.toCharArray();
|
||||||
|
|
||||||
|
try {
|
||||||
KeyStore ks = KeyStore.getInstance("PKCS12");
|
KeyStore ks = KeyStore.getInstance("PKCS12");
|
||||||
ks.load(fis, keystorePassword);
|
ks.load(fis, keystorePassword);
|
||||||
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
|
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
|
||||||
kmf.init(ks, keystorePassword);
|
kmf.init(ks, keystorePassword);
|
||||||
|
} catch (Exception e) {
|
||||||
|
KeyStore ks = KeyStore.getInstance("PKCS12");
|
||||||
|
ks.load(fis, "123456");
|
||||||
|
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
|
||||||
|
kmf.init(ks, "123456");
|
||||||
|
} catch (Exception e) {
|
||||||
|
Grasscutter.getLogger().warn("[Dispatch] Error while loading keystore!");
|
||||||
|
}
|
||||||
|
|
||||||
sslContext.init(kmf.getKeyManagers(), null, null);
|
sslContext.init(kmf.getKeyManagers(), null, null);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user