Problem: Google refuses to publish the application on Google.Play . Reason: The vulnerabilities were fixed in OpenSSL versions beginning with 1.0.1h, 1.0.0m, and 0.9.8za .
Used by Android Studio 1.5 , Windows 7 . All packages are updated to the latest versions.
Tell me how to update OpenSSL ? Thank you very much for the help!
Application code:
import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.URL; import java.security.SecureRandom; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; public class DBAction { DBAction() { } public static String getData(String id, String passkey, String command, String param){ String response = ""; try { String q = "https://myserver.com"; HostnameVerifier TRUST_ALL_CERTIFICATES = new HostnameVerifier() { public boolean verify(String hostname, SSLSession session) { return true; } }; SSLContext Cur_SSL_Context = null; try { Cur_SSL_Context = SSLContext.getInstance("TLS"); Cur_SSL_Context.init(null, new TrustManager[] { new X509_Trust_Manager() }, new SecureRandom()); } catch (Exception e) { e.printStackTrace(); } HttpsURLConnection.setDefaultHostnameVerifier(TRUST_ALL_CERTIFICATES); HttpsURLConnection.setDefaultSSLSocketFactory(Cur_SSL_Context.getSocketFactory()); URL url = new URL(q); HttpsURLConnection httpsURLConnection= (HttpsURLConnection) url.openConnection(); httpsURLConnection.setRequestMethod("POST"); httpsURLConnection.setDoOutput(true); String urlParameters =DBHelper.PARAM_POST_ID+"="+id+ "&" + DBHelper.PARAM_POST_PASSKEY + "="+passkey; if (param != null) { urlParameters += "&"; urlParameters += DBHelper.PARAM_POST_PARAM; urlParameters += "="; urlParameters = param; } DataOutputStream wr = new DataOutputStream(httpsURLConnection.getOutputStream()); wr.writeBytes(urlParameters); wr.flush(); wr.close(); BufferedReader in = new BufferedReader( new InputStreamReader(httpsURLConnection.getInputStream())); String inputLine; StringBuffer stringBuffer = new StringBuffer(); while ((inputLine = in.readLine()) != null) { stringBuffer.append(inputLine); } in.close(); int responseCode = httpsURLConnection.getResponseCode(); response = stringBuffer.toString(); } catch (Exception e) { System.out.print("Exception = " + e); } return response; } private static class X509_Trust_Manager implements X509TrustManager { @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} @Override public X509Certificate[] getAcceptedIssuers() { return null; } }; } UPD : The '$ unzip -p YourApp.apk recommended by Google command | strings | grep "OpenSSL" 'gives an empty result
UPD2 : libs is empty
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' }