You can set one by getting the one from the database you just opened to 
setup the replication:

PersistentCookieStore cookieStore = database.getPersistentCookieStore();
CouchbaseLiteHttpClientFactory factory = new 
CouchbaseLiteHttpClientFactory(cookieStore); 
manager.setDefaultHttpClientFactory(factory);
factory.setSSLSocketFactory(sf);

It works fine for me.

On Thursday, June 5, 2014 11:24:56 PM UTC, Traun Leyden wrote:
>
>
> Actually I don't think that will work, because manager will probably 
> return null unless you've set one previously.
>
> I filed an issue with a possible workaround here: 
> https://github.com/couchbase/couchbase-lite-java-core/issues/223
>
>
>
> On Wed, Jun 4, 2014 at 4:57 AM, Michael Hines <[email protected] 
> <javascript:>> wrote:
>
>> You have to do it like this:
>>
>> ((CouchbaseLiteHttpClientFactory) 
>> manager.getDefaultHttpClientFactory()).setSSLSocketFactory(sf);
>>
>> Way too complicated, but that's what the source code says =).
>>
>> - Michael
>>
>>
>> On Friday, May 30, 2014 9:17:53 AM UTC, Anna wrote:
>>>
>>> I have updated to 'com.couchbase.lite:couchbase-lite-android:1.0.0-55' 
>>> and now the solution using:
>>>
>>> CouchbaseLiteHttpClientFactory.INSTANCE.setSSLSocketFactory(sf);
>>>
>>> won't work because one cannot access INSTANCE this way anymore. Is there 
>>> any other solutions available as the Couchbase lite Android was updated?
>>>
>>> Den fredagen den 4:e april 2014 kl. 09:56:52 UTC+2 skrev Anna:
>>>>
>>>> I got the exception: 
>>>>
>>>> 04-04 09:44:06.708  27762-27905/ideal.fill.in E/Database﹕ io exception
>>>>     javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
>>>>             at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.
>>>> getPeerCertificates(SSLSessionImpl.java:146)
>>>>             at org.apache.http.conn.ssl.AbstractVerifier.verify(
>>>> AbstractVerifier.java:93)
>>>>             at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(
>>>> SSLSocketFactory.java:388)
>>>>             at org.apache.http.impl.conn.DefaultClientConnectionOperato
>>>> r.openConnection(DefaultClientConnectionOperator.java:173)
>>>>             at org.apache.http.impl.conn.AbstractPoolEntry.open(
>>>> AbstractPoolEntry.java:164)
>>>>             at org.apache.http.impl.conn.AbstractPooledConnAdapter.
>>>> open(AbstractPooledConnAdapter.java:119)
>>>>             at org.apache.http.impl.client.DefaultRequestDirector.
>>>> execute(DefaultRequestDirector.java:360)
>>>>             at org.apache.http.impl.client.AbstractHttpClient.execute(
>>>> AbstractHttpClient.java:555)
>>>>             at org.apache.http.impl.client.AbstractHttpClient.execute(
>>>> AbstractHttpClient.java:487)
>>>>             at org.apache.http.impl.client.AbstractHttpClient.execute(
>>>> AbstractHttpClient.java:465)
>>>>             at com.couchbase.lite.support.RemoteRequest.executeRequest(
>>>> RemoteRequest.java:126)
>>>>             at com.couchbase.lite.support.RemoteRequest.run(
>>>> RemoteRequest.java:83)
>>>>             at java.util.concurrent.ThreadPoolExecutor.runWorker(
>>>> ThreadPoolExecutor.java:1080)
>>>>             at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>>> ThreadPoolExecutor.java:573)
>>>>             at java.lang.Thread.run(Thread.java:841)
>>>> 04-04 09:44:06.708  27762-28031/ideal.fill.in D/Database﹕ 
>>>> com.couchbase.lite.replicator.Replication$5@4247d450 error getting 
>>>> remote checkpoint: javax.net.ssl.SSLPeerUnverifiedException: No peer 
>>>> certificate
>>>> 04-04 09:44:06.718  27762-28031/ideal.fill.in E/Database﹕ 
>>>> Puller@42323d18[https://---:[email protected]/groups] 
>>>> Progress: set error = javax.net.ssl.SSLPeerUnverifiedException: No 
>>>> peer certificate
>>>>
>>>> Is there any I can resolve this? or what could be a cause for that?
>>>> Url that I use for pulling from the database is 
>>>> https://admin:password@....
>>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Couchbase Mobile" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>>  To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mobile-couchbase/e0ee727d-0169-4c5e-9510-aa7f4bb6233d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mobile-couchbase/e0ee727d-0169-4c5e-9510-aa7f4bb6233d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" 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/mobile-couchbase/3e32a28e-f0ab-4818-b33a-752b3f93c842%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to