Self Signed Ssl Cert Problem

i am using self signed ssl certificate for my web site,
when i try to navigate my site page did not loaded,
when i searched from from web and found some solutions like :

in my code i overrided some methods like :

public boolean webViewShouldStartLoadWithRequestNavigationType(UIWebView webView, NSURLRequest request, @NInt long navigationType) {
        authRequest = request;
        NSURLConnection urlConnection = NSURLConnection.alloc().initWithRequestDelegate(request, this);
        return false;
    else { // write your method for this
        return true;

public boolean connectionCanAuthenticateAgainstProtectionSpace(NSURLConnection connection, NSURLProtectionSpace protectionSpace) {
    return protectionSpace.authenticationMethod().equals(Foundation.NSURLAuthenticationMethodServerTrust());

public void connectionDidReceiveAuthenticationChallenge(NSURLConnection connection, NSURLAuthenticationChallenge challenge) {
    if (challenge.previousFailureCount() == 0 &&  challenge.protectionSpace().authenticationMethod().equals(Foundation.NSURLAuthenticationMethodServerTrust()))
        authenticated = true;
        NSURLCredential nsurlCredential = NSURLCredential.credentialForTrust(challenge.protectionSpace().serverTrust());
        NSURL baseURL = NSURL.URLWithString("");
        if (challenge.protectionSpace().host() .equals( {

But it throws exception:

017-09-13 11:11:20.335 ios2[2561:48336] *** Terminating app due to uncaught exception ‘java.lang.IncompatibleClassChangeError’, reason: 'java.lang.IncompatibleClassChangeError: Class ‘’ does not implement interface ‘’ in call to ‘void,’

what is wrong with my code?
is that solution is right? if not is there alternative solutions ?
does apple accepts applications which try to connect http sites with self-signed ssl cert ?


Dear @kurul

Follow this link


that link solves http call via httpclient,
but what if UIWebView component ?
i mean can we navigate that url with UIWebView ?

visit this link too.

You only need to write this code in objective-c.
Hope your doing your best.

Dear saeed,

i re-write that code in java, i am using moe-1.2+ but in the method below exception occurs:

public void connectionWillSendRequestForAuthenticationChallenge(NSURLConnection connection, NSURLAuthenticationChallenge challenge) {




2017-09-13 15:33:35.790 ios2[5383:119873] *** Terminating app due to uncaught exception ‘java.lang.IncompatibleClassChangeError’, reason: 'java.lang.IncompatibleClassChangeError: Class ‘’ does not implement interface ‘’ in call to ‘void,’

Dear Kurul,

Could you please check with the latest 1.3.12 moe-gradle setting?

Best Regards,