We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The certificate KPCS12 is compatible with Ksoap2? the following code does not work , returns the error: IOException e: SSL handshake aborted: ssl=0x7a69ed90: I/O error during system call, Connection reset by peer Code: private SSLSocketFactory getSSLSocketFactory() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException { KeyStore trusted = KeyStore.getInstance("PKCS12"); AssetManager assetManager = getAssets(); InputStream in = null; try { in = assetManager.open("certificate.p12"); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { trusted.load(in, "blablabla".toCharArray()); } catch (CertificateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try { in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509"); tmf.init(trusted); SSLContext context = SSLContext.getInstance("SSLv3"); context.init(null, tmf.getTrustManagers(), null); return context.getSocketFactory(); } public String SendRecieveMessage(SoapObject xmlData, String nameXML, String methodName, String methodAction) { HttpsTransportSE httpTransport = new KeepAliveHttpsTransportSE("hostname", 8443, "/blablabla/blablabla?wsdl", 1000); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapObject request = new SoapObject(activity.getResources().getString(R.string.SOAP_NAMESPACE), methodName); // set envelope.setOutputSoapObject(xmlData); try { ((HttpsServiceConnectionSE) httpTransport.getServiceConnection()).setSSLSocketFactory(getSSLSocketFactory()); } catch (KeyManagementException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (KeyStoreException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NoSuchAlgorithmException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } SoapPrimitive result = null; try { httpTransport.call(methodAction, envelope); result = (SoapPrimitive) envelope.getResponse(); } catch (IOException e) { // TODO Auto-generated catch block Log.e("ERROR", "SOAPSendRecieve: " + e.getMessage()); // <!-------------------- Error exception this here } catch (XmlPullParserException e) { // TODO Auto-generated catch block Log.e("ERROR", "SOAPSendRecieve: " + e.getMessage()); } catch (IllegalArgumentException e) { Log.e("ERROR", "SOAPSendRecieve: " + e.getMessage()); } } finally { request = null; result = null; } return result; }
Original issue reported on code.google.com by [email protected] on 4 Dec 2014 at 2:44
[email protected]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Original issue reported on code.google.com by
[email protected]
on 4 Dec 2014 at 2:44The text was updated successfully, but these errors were encountered: