diff options
author | Alexander Sulfrian <asulfrian@zedat.fu-berlin.de> | 2019-03-09 07:00:04 +0100 |
---|---|---|
committer | Alexander Sulfrian <asulfrian@zedat.fu-berlin.de> | 2019-03-09 07:00:04 +0100 |
commit | 5514a9a5a1fbf0204927300a5af73c251cdf3799 (patch) | |
tree | 9c9b9dff77fdb2aa5ee01e9dba10c8c5449fb911 /src/main/java/nn | |
parent | b13d00e372b7731a87c8b4d81dfd5454214b8cfa (diff) | |
download | kvm-5514a9a5a1fbf0204927300a5af73c251cdf3799.tar.gz kvm-5514a9a5a1fbf0204927300a5af73c251cdf3799.tar.bz2 kvm-5514a9a5a1fbf0204927300a5af73c251cdf3799.zip |
Add first version of the applet launcher
Diffstat (limited to 'src/main/java/nn')
-rw-r--r-- | src/main/java/nn/pp/rc/JSSE14_SSLConnector.java | 26 | ||||
-rw-r--r-- | src/main/java/nn/pp/rc/u.java | 55 |
2 files changed, 81 insertions, 0 deletions
diff --git a/src/main/java/nn/pp/rc/JSSE14_SSLConnector.java b/src/main/java/nn/pp/rc/JSSE14_SSLConnector.java new file mode 100644 index 0000000..487b1b9 --- /dev/null +++ b/src/main/java/nn/pp/rc/JSSE14_SSLConnector.java @@ -0,0 +1,26 @@ +package nn.pp.rc; + +import javax.net.ssl.SSLSocketFactory; + +import de.spline.kvm.utils.ReflectionUtils; +import de.spline.kvm.utils.SSLUtils; + +/** + * We replace the JSSE14_SSLConnector with our own version. + * + * The default class from the applet uses a broken (outdated?) + * X509PluginTrustManager. So we simply use your own SSLSocketFactory here, + * that already has a correct setup for TLS connections of the remote console. + */ +public class JSSE14_SSLConnector extends aq +{ + public JSSE14_SSLConnector() { + // Just visual stuff to beautify the display name of this connector + ReflectionUtils.setField(aq.class, this, "do", "TLS"); + } + + public SSLSocketFactory a() + { + return SSLUtils.getSocketFactory(); + } +} diff --git a/src/main/java/nn/pp/rc/u.java b/src/main/java/nn/pp/rc/u.java new file mode 100644 index 0000000..c5c08d4 --- /dev/null +++ b/src/main/java/nn/pp/rc/u.java @@ -0,0 +1,55 @@ +package nn.pp.rc; + +import java.applet.Applet; +import java.awt.Frame; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +/** + * This is a simple class to override the nn.pp.rc.u class from the applet. + * + * We need to do this, because the original class is doing some nasty things in + * the processWindowEvent method. This class has the same name (and the same + * package) and is somewhere before the applet in the classpath. So we cannot + * import the original class here, but the class is so simple, that we can + * implement it from scratch. + */ +public class u extends Frame +{ + ServerConsolePanelBase consolePanel; + + public u(Applet applet, String title, ServerConsolePanelBase consolePanel) + { + super(title + " Remote Console"); + this.consolePanel = consolePanel; + this.add(consolePanel, "Center"); + + this.addWindowListener(new WindowAdapter() + { + @Override + public void windowClosing(WindowEvent windowEvent) + { + applet.stop(); + } + }); + } + + /** + * Close this frame. + */ + public void a() + { + this.setVisible(false); + this.setState(0); + this.dispose(); + + // "Close" the console panel + consolePanel.r(); + } + + public void a(String path, String target) + { + // Nothing here, because we do not need the redirection to another page + // when the applet exists. + } +} |