Aw... They removed the constructor for SSLSocketFactory(java.net.ssl.SSLContext) from public API :(
You can extend the SSLSocketFactory(to bypass ALL verification ever) or Add your key to a trust store and create SSLSocketFactory(java.security.KeyStore truststore) On 8 фев, 21:48, NeoRiddle <[email protected]> wrote: > Thank you very much for your answer. > > I have checked these links, but there is something strange... > > In the second link (Android API reference) suggest to use Scheme > object. This constructor takes SocketFactory (some class which > implements org.apache.http.conn.scheme.SocketFactory, they could be: > LayeredSocketFactory, MultihomePlainSocketFactory, PlainSocketFactory, > SSLSocketFactory) > > Scheme https = new Scheme("https", new MySocketFactory(), 443); > SchemeRegistry.DEFAULT.register(https); > > But in the first link, there is a way to create a SSLSocketFactory > using SSLContext initialized with a "easy"-TrustManager, but this > SSLSocketFactory is another object (is > javax.net.ssl.SSLSocketFactory): > > SSLContext sslcontext = SSLContext.getInstance("TLS"); > sslcontext.init(null, new TrustManager[] { easyTrustManager }, null); > SSLSocketFactory sf = new SSLSocketFactory(sslcontext); > > There are different classes with a similar name: > javax.net.ssl.SSLSocketFactory and > org.apache.http.conn.ssl.SSLSocketFactory. > > On Feb 8, 4:09 am, "JAlexoid (Aleksandr Panzin)" <[email protected]> > wrote: > > > Get a free certificate fromwww.startcom.org? > > Or do it the long way: > > >http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.... > > > and > > >http://developer.android.com/intl/de/reference/org/apache/http/conn/s... > > > On 8 фев, 01:37, NeoRiddle <[email protected]> wrote: > > > > Hi! > > > > I am developing some application which send and HTTP form, using HTTP > > > POST method. > > > I must use HTTPS, so the resource at server is under HTTPS (https:// > > > myserver.com/myresource.php), for develop I am using a self-signed > > > certificate for server. > > > > Here you have the method which try to send this form by > > > HTTPS:http://pastebin.com/ka47sRU6 > > > There I create a DefaultHttpClient using a custom which try to use > > > HTTPS:http://pastebin.com/K2Hz2L17 > > > > But everything seems to be ok, until I run this code and get an > > > exception: javax.net.ssl.SSLException: Not trusted server certificate. > > > > How can I solve this? > > > > If you need more info, please feel free to ask me. > > > > Thank you very much. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

