diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2015-09-20 23:00:52 -0400 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2015-09-20 23:00:52 -0400 |
commit | b7f18a36a47715910f918d13a8945baac89d0f73 (patch) | |
tree | 63b4f8e0e529f102f3052f41fe1176fad4cc4fce /java/com/tigervnc/rfb | |
parent | 395a93418b6acdb6a02ab575c540152dc81295c5 (diff) | |
download | tigervnc-b7f18a36a47715910f918d13a8945baac89d0f73.tar.gz tigervnc-b7f18a36a47715910f918d13a8945baac89d0f73.zip |
Don't exit completely if single viewer declines server cert
Prevents viewer from exiting completely just because user
declined to trust the server certificate for a single connection.
Copied from TurboVNC.
Diffstat (limited to 'java/com/tigervnc/rfb')
-rw-r--r-- | java/com/tigervnc/rfb/CSecurityTLS.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/com/tigervnc/rfb/CSecurityTLS.java b/java/com/tigervnc/rfb/CSecurityTLS.java index 42e000e4..e7510c8b 100644 --- a/java/com/tigervnc/rfb/CSecurityTLS.java +++ b/java/com/tigervnc/rfb/CSecurityTLS.java @@ -3,7 +3,8 @@ * Copyright (C) 2005 Martin Koegler * Copyright (C) 2010 m-privacy GmbH * Copyright (C) 2010 TigerVNC Team - * Copyright (C) 2011-2012,2015 Brian P. Hinz + * Copyright (C) 2011-2015 Brian P. Hinz + * Copyright (C) 2015 D. R. Commander. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -138,7 +139,10 @@ public class CSecurityTLS extends CSecurity { manager = new SSLEngineManager(engine, is, os); manager.doHandshake(); } catch(java.lang.Exception e) { - throw new Exception(e.getMessage()); + if (e.getMessage().equals("X.509 certificate not trusted")) + throw new WarningException(e.getMessage()); + else + throw new SystemException(e.toString()); } //checkSession(); @@ -345,10 +349,10 @@ public class CSecurityTLS extends CSecurity { } } } else { - System.exit(1); + throw new WarningException("X.509 certificate not trusted"); } } else { - throw new Exception(e.getCause().getMessage()); + throw new SystemException(e.getCause().getMessage()); } } catch (java.lang.Exception e) { throw new Exception(e.getCause().getMessage()); |