If you are experiencing an issue please mention the full platform your 
issue applies to:
IDE: Eclipse
Desktop OS: linux

We have a web project which is always working fine, it just using codename 
one push api to push notification to our devices, but it suddenly get the 
following error: "javax.net.ssl.SSLHandshakeException: Received fatal 
alert: handshake_failure", no mattter at local, UAT or Prod server.


Below is the core code (same with codenamoe one demo), I just create a 
function to call it.


HttpURLConnection connection = (HttpURLConnection)new 
URL("https://push.codenameone.com/push/push";).openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", 
"application/x-www-form-urlencoded;charset=UTF-8");String cert = 
ITUNES_DEVELOPMENT_PUSH_CERT;String pass = 
ITUNES_DEVELOPMENT_PUSH_CERT_PASSWORD;if(ITUNES_PRODUCTION_PUSH) {
    cert = ITUNES_PRODUCTION_PUSH_CERT;
    pass = ITUNES_PRODUCTION_PUSH_CERT_PASSWORD;}String query = "token="  + 
PUSH_TOKEN +
    "&device=" + URLEncoder.encode(deviceId1, "UTF-8") +
    "&device=" + URLEncoder.encode(deviceId2, "UTF-8") +
    "&device=" + URLEncoder.encode(deviceId3, "UTF-8") +
    "&type=1" +
    "&auth=" + URLEncoder.encode(FCM_SERVER_API_KEY, "UTF-8") +
    "&certPassword=" + URLEncoder.encode(pass, "UTF-8") +
    "&cert=" + URLEncoder.encode(cert, "UTF-8") +
    "&body=" + URLEncoder.encode(MESSAGE_BODY, "UTF-8") +
    "&production=" + ITUNES_PRODUCTION_PUSH +
    "&sid=" + URLEncoder.encode(WNS_SID, "UTF-8") +
    "&client_secret=" + URLEncoder.encode(WNS_CLIENT_SECRET, "UTF-8");try 
(OutputStream output = connection.getOutputStream()) {
    output.write(query.getBytes("UTF-8"));}int c = 
connection.getResponseCode();// read response JSON

I directly run the code in unit test(localhost), it works well.

But when I call the function from project (such as a button from webpage), 
the error happened.


The error happened when run "OutputStream output = connection.
getOutputStream()", I never change any code about it, the error suddenly 
happened from yesterday.


I tried several way to solve it but still can not work, please give me some 
suggestion to fix the issue. Thank you!

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/edf99375-6e05-4ecc-bbf7-7d96b74b89cd%40googlegroups.com.

Reply via email to