/*
 *     Copyright 2015 IBM Corp.
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *     See the License for the specific language governing permissions and
 *     limitations under the License.
 */

package com.ibm.mobilefirstplatform.clientsdk.android.security.mca.internal;

import com.ibm.mobilefirstplatform.clientsdk.android.core.api.ResponseListener;
import com.ibm.mobilefirstplatform.clientsdk.android.core.internal.BaseRequest;
import com.squareup.okhttp.OkHttpClient;

import java.net.MalformedURLException;
import java.util.Map;

/**
 * Created by vitalym on 10/14/15.
 */

/**
 * AuthorizationRequest is used internally to send authorization requests.
 */
public class AuthorizationRequest extends BaseRequest {

    private static OkHttpClient httpClient = new OkHttpClient();

    /**
     * Constructs the authorization request
     * @param url request url
     * @param method request method
     * @throws MalformedURLException if url is not valid
     */
    public AuthorizationRequest(String url, String method) throws MalformedURLException {
        super(url, method);

        // we want to handle redirects in-place
        httpClient.setFollowRedirects(false);
    }

    /**
     * Override the base getter to return authrization http client
     * @return internal http client
     */
    protected OkHttpClient getHttpClient() {
        return httpClient;
    }

    /**
     * Setup network interceptor.
     */
    public static void setup(){
        httpClient.setFollowRedirects(false);
    }

    @Override
    public void send(final ResponseListener listener) {
        super.send(listener);
    }

    @Override
    public void send(Map<String, String> formParameters, ResponseListener listener) {
        super.send(formParameters, listener);
    }


}

@@ -867,349 +867,934 @@
 com.
-squareup.okhttp.OkHttpClient;%0A%0Aimport java.net.MalformedURLException;%0Aimport java.util.Map;%0A%0A/**%0A * Created by vitalym on 10/14/15.%0A */%0A%0A/**%0A * AuthorizationRequest is used internally to send authorization requests.%0A */%0Apublic class AuthorizationRequest extends BaseRequest %7B%0A%0A    private static OkHttpClient httpClient = new OkHttpClient();
+ibm.mobilefirstplatform.clientsdk.android.core.internal.TLSEnabledSSLSocketFactory;%0Aimport com.squareup.okhttp.OkHttpClient;%0A%0Aimport java.net.MalformedURLException;%0Aimport java.security.KeyManagementException;%0Aimport java.security.NoSuchAlgorithmException;%0Aimport java.util.Map;%0A%0Aimport javax.net.ssl.SSLSocketFactory;%0A%0A/**%0A * AuthorizationRequest is used internally to send authorization requests.%0A */%0Apublic class AuthorizationRequest extends BaseRequest %7B%0A%0A    private static OkHttpClient httpClient = new OkHttpClient();%0A%0A    static %7B%0A        SSLSocketFactory tlsEnabledSSLSocketFactory;%0A        try %7B%0A            tlsEnabledSSLSocketFactory = new TLSEnabledSSLSocketFactory();%0A            httpClient.setSslSocketFactory(tlsEnabledSSLSocketFactory);%0A        %7D catch (KeyManagementException e) %7B%0A            e.printStackTrace();%0A        %7D catch (NoSuchAlgorithmException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D
 %0A%0A  

Add TLS 1.2 support to MCA HTTP client.