1 Index: new/java/com/tigervnc/rfb/CSecurityTLS.java
2 ===================================================================
3 --- new.orig/java/com/tigervnc/rfb/CSecurityTLS.java 2013-04-18 11:56:22.000000000 +0200
4 +++ new/java/com/tigervnc/rfb/CSecurityTLS.java 2013-04-18 13:59:03.000000000 +0200
7 import java.io.InputStream;
8 import java.io.FileInputStream;
9 +import java.io.ByteArrayInputStream;
10 import java.util.ArrayList;
11 import java.util.Collection;
12 import javax.swing.JOptionPane;
15 public class CSecurityTLS extends CSecurity {
17 + public static StringParameter PVECert
18 + = new StringParameter("PVECert",
19 + "Proxmox VE CA certificate", "");
20 public static StringParameter x509ca
21 = new StringParameter("x509ca",
22 "X509 CA certificate", "");
28 + pvecert = PVECert.getData();
29 cafile = x509ca.getData();
30 crlfile = x509crl.getData();
33 CertificateFactory cf = CertificateFactory.getInstance("X.509");
36 - File cacert = new File(cafile);
37 - if (!cacert.exists() || !cacert.canRead())
39 - InputStream caStream = new FileInputStream(cafile);
40 + InputStream caStream;
41 + if (pvecert != null) {
42 + caStream = new ByteArrayInputStream(pvecert.getBytes("ISO-8859-1"));
44 + File cacert = new File(cafile);
45 + if (!cacert.exists() || !cacert.canRead())
47 + caStream = new FileInputStream(cafile);
49 X509Certificate ca = (X509Certificate)cf.generateCertificate(caStream);
50 ks.setCertificateEntry("CA", ca);
51 PKIXBuilderParameters params = new PKIXBuilderParameters(ks, new X509CertSelector());
54 private SSLSession session;
55 private String cafile, crlfile;
56 + private String pvecert;
58 private SSLSocket ssl;
60 Index: new/java/com/tigervnc/vncviewer/VncViewer.java
61 ===================================================================
62 --- new.orig/java/com/tigervnc/vncviewer/VncViewer.java 2013-04-18 11:56:21.000000000 +0200
63 +++ new/java/com/tigervnc/vncviewer/VncViewer.java 2013-04-18 13:56:33.000000000 +0200
66 alwaysShowServerDialog.setParam(true);
67 Configuration.readAppletParams(this);
68 + String tmpcert = this.getParameter("PVECert");
69 + if (tmpcert != null) {
70 + CSecurityTLS.PVECert.setParam(tmpcert.replace('|', '\n'));
73 String host = getCodeBase().getHost();
74 if (vncServerName.getValue() == null && vncServerPort.getValue() != 0) {
75 int port = vncServerPort.getValue();