Https authentication failed
ych
Posts: 44
I have no problem testing the code on the computer. I can communicate with the device via https, but it is not successful after uploading to the device. I cannot establish HTTPS communication with the device. Have you ever encountered this situation?
0
Comments
Capture and paste the Java error log from NetLinx Studio Diagnostics would be helpful.
Hi, I emailed you to inquire about this issue. At that time, I used the program you sent me to skip SSL authentication to test Huawei BOX terminal skipping SSL, and it was unsuccessful!
For the benefit of others who might find the same problem pasting the Java error log here would be helpful.
Using org. eclipse. jetty. client. HttpClient, the controller prompts an error:
javax.net.ssl.SSLException: Received fatal alert: handshake_failure
public class httputility {
private static HttpClient _httpclient=null;
private static String cookie=null;
private static SslContextFactory ContextFactory=null;
static void intizationHttpClient() throws Exception{
try {
ContextFactory=new SslContextFactory();
ContextFactory.setTrustAll(true);
_httpclient =new HttpClient(ContextFactory);
_httpclient.setConnectTimeout(5000);
_httpclient.setFollowRedirects(false);
_httpclient.setCookieStore(new HttpCookieStore.Empty());
_httpclient.start();
}catch(Exception e) {
System.out.println(e.getMessage());
}
}
Use javax. net. ssl. HttpsURLConnection;, Controller prompt error:
Received fatal alert: handshake_failure
static {
disableSslVerification();
}
Still need to see the detailed Java error log as printed to Diagnostics.
Also if you are not using a minimum of NX f/w 1.6.201 then you could be running into unsupported cypher key issues.
@ych - The product page only contains the official release version. Go here for hot fix versions -
https://help.harmanpro.com/nx-master
hi:
I have upgraded my firmware to v1.6.205 and tested it using org.eclipse.kitty.client.HttpClient. The computer is running normally, but uploading to the controller still fails, prompting a handshake error:
Line 207 2023-03-21 (09:25:31):: javax.net.ssl.SSLException: Received fatal alert: handshake_ failure
The test using javax.net.ssl.HttpsURLConnection cannot be uploaded to the controller. Prompt:
Line 77 2023-03-21 (11:03:01):: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Printing the full error log to Diagnostics will output a very accurate log of what wrong including the class and code line number. This will be more helpful to debug your code than just the generic Exception that was found.
And this code snippet snippet doesn't make sense to me
You would probably better off passing the httpsconnection as a parameter to the disableSslVerification - as it has to be applied to every https connection, not just one.
Hello!
I have modified the following code to allow verification to be skipped using httpsconnection, but it is still not possible to skip verification using org.eclipse.detty.client.HttpClient:
static void intizationHttpClient(){
try {
TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
};
Controller prompt:javax.net.ssl.SSLException: Received fatal alert: handshake_failure
This is the method we use to load the device certificate to the NX truststore - it shows how to implement a trust all certificate javax.net.ssl.HttpsURLConnection. This method is called in most of the published AMX Duet modules where the device is a physical device on the local network. You can also try getting the certificate and loading it to the Duet TrustStore through the NetLinx Studio Certificate Manager then just let the HTTPS connection run its normal course through the underlying system processes to establish the trust with the device. The RMS Admistrators Guide https://www.amx.com/en-US/site_elements/system-administrator-s-manual-rms-enterprise-resource-management-suite has step by step directions for importing into the Duet TrustStore.
If this doesn't help you figure out how to get your code working you will need to start digging around sourceforge.net or other open source resources for the answer.
I can understand the code you sent. If you need to keep a long link,justignore discoonnect.
Is there a program for the amx central control to control Huawei box310? brother
No module available in the resource center.
By documentation it is HTTP with JSON
https://support.huawei.com/enterpriseics/Box 310/22.2.2/topic/view.do?portalid=1665222519830&hdxfileid=HWICS1000001242&pidid=pid_bookmap_0000001511518532&topicid=TOPIC_0000001511518668&relationid=default&path=