mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46: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\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
||||
if(optButton.isPresent() && optButton.get() == ButtonType.YES) {
|
||||
crtFile.delete();
|
||||
Platform.runLater(() -> restartService(connectionService));
|
||||
return;
|
||||
if(crtFile.delete()) {
|
||||
Platform.runLater(() -> restartService(connectionService));
|
||||
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." +
|
||||
"\n\nThis may indicate a man-in-the-middle attack!" +
|
||||
"\n\nDo you still want to proceed?", ButtonType.NO, ButtonType.YES);
|
||||
if(optButton.isPresent()) {
|
||||
if(optButton.get() == ButtonType.YES) {
|
||||
savedCrtFile.delete();
|
||||
if(optButton.isPresent() && optButton.get() == ButtonType.YES) {
|
||||
if(savedCrtFile.delete()) {
|
||||
Platform.runLater(this::startElectrumConnection);
|
||||
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