Hi,
I have a couple of application running on Android.
They access to different webservice hosted in Windows machine , and that
woarked fine until the last Netbeans Codenameone plugin update.
Now when I try to access the webservice specifying the address as http , I
get a '500 Internal server error'
I tried to install a self signed ssl certificate into the server and when
when I try to access the webservice specifying the address as https I get
the following exception :
'javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative names
present'
I think It's a certificate issue.
Both methods (http and https) work fine from Firefox and Chromium (manually
trusting the certificate when using https).
I tried some tips read from the net .
I.e.
added the build hint
ios.plistinject=<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict><key>CFBundleURLTypes</key>
<array> <dict> <key>CFBundleURLName</key>
<string>it.vtsystem.sigemmobile.SIGEMMobile</string> </dict> <dict>
<key>CFBundleURLSchemes</key> <array> <string>SIGEMMobile</string> </array>
</dict> </array>
I tried some methods to disable the java check
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(
new javax.net.ssl.HostnameVerifier() {
public boolean verify(String hostname,
javax.net.ssl.SSLSession sslSession) {
return hostname.equals("localhost");
}
});
and
private static void disableSslVerification() {
try {
// Create a trust manager that does not validate certificate
chains
TrustManager[] trustAllCerts = new TrustManager[]{new
X509TrustManager() {
public java.security.cert.X509Certificate[]
getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs,
String authType) {
}
public void checkServerTrusted(X509Certificate[] certs,
String authType) {
}
}
};
// Install the all-trusting trust manager
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.
getSocketFactory());
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
// Install the all-trusting host verifier
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
}
}
but I cannot compile any of the 2 with codenameone (not investigated too
much ...)
I should like to continue using http (I'm NOT concerned with IOS builds)
Please give me back the last functioning plugin
or let me know how to solve
I have a customer pressing for a bug-fix and I cannot have a running
application .... and I's holiday time too !!!!
Please helpppppppp !!!!!!
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/2361ba33-59bd-42f6-98fb-8849a85e0fb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.