weizhouapache commented on issue #5413:
URL: https://github.com/apache/cloudstack/issues/5413#issuecomment-914968104
@nvazquez @davidjumani
have a quick check, it looks the certitificate is handled in #4300 by @rhtyd
```
public class WebSocketReverseProxy extends WebSocketClient {
private static final Protocol protocol = new Protocol("binary");
private static final DefaultExtension defaultExtension = new
DefaultExtension();
private static final Draft_6455 draft = new
Draft_6455(Collections.singletonList(defaultExtension),
Collections.singletonList(protocol));
private static final Logger logger =
Logger.getLogger(WebSocketReverseProxy.class);
private Session remoteSession;
private void acceptAllCerts() {
TrustManager[] trustAllCerts = new TrustManager[]{new
X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers()
{
return new java.security.cert.X509Certificate[]{};
}
public void checkClientTrusted(X509Certificate[] chain,
String authType) throws
CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain,
String authType) throws
CertificateException {
}
}};
SSLContext sc;
try {
sc = SSLContext.getInstance("TLS");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
SSLSocketFactory factory = sc.getSocketFactory();
this.setSocketFactory(factory);
} catch (Exception e) {
e.printStackTrace();
}
}
...
```
I cannot reproduce the issue in my testing env (vmware 7).
```
2021-09-08 06:33:08,521 INFO [cloud.consoleproxy.ConsoleProxyNoVNCHandler]
(qtp663952265-36:null) Get websocket connection request from remote IP :
172.16.250.3
2021-09-08 06:33:08,539 INFO [cloud.consoleproxy.ConsoleProxyNoVncClient]
(Thread-154:null) Connect to VNC over websocket URL:
wss://10.0.34.176:443/ticket/c5fbc972af4f26c8
2021-09-08 06:33:09,211 INFO
[cloud.consoleproxy.ConsoleProxyResourceHandler] (Thread-157:null) Get resource
request for /resource/noVNC/app/images/handle_bg.svg
2021-09-08 06:33:09,217 INFO
[cloud.consoleproxy.ConsoleProxyResourceHandler] (Thread-157:null) file does
not exist/resource/noVNC/app/images/handle_bg.svg
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]