mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
warn if saved certificate file could not be deleted
This commit is contained in:
parent
9c87ecd4ec
commit
b0f60bb671
2 changed files with 10 additions and 6 deletions
|
@ -292,9 +292,12 @@ public class AppServices {
|
||||||
"\n\nThis may indicate a man-in-the-middle attack!" +
|
"\n\nThis may indicate a man-in-the-middle attack!" +
|
||||||
"\n\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
"\n\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
||||||
if(optButton.isPresent() && optButton.get() == ButtonType.YES) {
|
if(optButton.isPresent() && optButton.get() == ButtonType.YES) {
|
||||||
crtFile.delete();
|
if(crtFile.delete()) {
|
||||||
Platform.runLater(() -> restartService(connectionService));
|
Platform.runLater(() -> restartService(connectionService));
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
AppServices.showErrorDialog("Could not delete certificate", "The certificate file at " + crtFile.getAbsolutePath() + " could not be deleted.\n\nPlease delete this file manually.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -587,11 +587,12 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
||||||
Optional<ButtonType> optButton = AppServices.showErrorDialog("SSL Handshake Failed", "The certificate provided by the server at " + tlsServerException.getServer().getHost() + " appears to have changed." +
|
Optional<ButtonType> optButton = AppServices.showErrorDialog("SSL Handshake Failed", "The certificate provided by the server at " + tlsServerException.getServer().getHost() + " appears to have changed." +
|
||||||
"\n\nThis may indicate a man-in-the-middle attack!" +
|
"\n\nThis may indicate a man-in-the-middle attack!" +
|
||||||
"\n\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
"\n\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
||||||
if(optButton.isPresent()) {
|
if(optButton.isPresent() && optButton.get() == ButtonType.YES) {
|
||||||
if(optButton.get() == ButtonType.YES) {
|
if(savedCrtFile.delete()) {
|
||||||
savedCrtFile.delete();
|
|
||||||
Platform.runLater(this::startElectrumConnection);
|
Platform.runLater(this::startElectrumConnection);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
AppServices.showErrorDialog("Could not delete certificate", "The certificate file at " + savedCrtFile.getAbsolutePath() + " could not be deleted.\n\nPlease delete this file manually.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue