title: okHTTP Unable to find acceptable protocols(android)
body: <p>Sorry for my english. I try using libruary OKhttp, and i use <strong>https</strong> for post reqest. Now i have error, when i try post my example, this is error:</p>
  
  <pre><code>java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA], tlsVersions=[TLS_1_2], supportsTlsExtensions=true)], supported protocols=[SSLv3, TLSv1]
  </code></pre>
  
  <p>I try fix it, but i cant do this. I dont know what i have this error</p>
  
  <p>And bellow my code:</p>
  
  <pre><code>public class PostOKhttp extends AsyncTask&lt;String, Void, String&gt; {
  
          @Override
          protected String doInBackground(String...ulr) {
              Response response = null;
              OkHttpClient client = new OkHttpClient();
              ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
                      .tlsVersions(TlsVersion.TLS_1_2)
                      .cipherSuites(
                              CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                              CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                              CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
                              CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
                              CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
                              CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
                              CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
                              CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
                              CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
                              CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA)
                      .build();
              client.setConnectionSpecs(Collections.singletonList(spec));
  
              RequestBody postForm = new FormEncodingBuilder()
                      .add("name", "name")
                      .build();
  
              Request request = new Request.Builder()
                      .url(ulr[0])
                      .addHeader("id", "--")
                      .addHeader("key", "--")
                      .post(postForm)
                      .build();
  
              try {
                  response = client.newCall(request).execute();
                  Log.e("post", response.body().string());
  
              } catch (Exception e) {
                  Log.e("error", e.toString());
              }
              return null;
  
          }
  
          @Override
          protected void onPostExecute(String result) {
  
          }
  </code></pre>
  
  <p><strong>UDP:</strong></p>
  
  <p>Use <strong>CertificatePinner</strong> </p>
  
  <p>i add this code</p>
  
  <pre><code>String link = "example.net";
  CertificatePinner certificatePinner = new CertificatePinner.Builder()
                      .add(link, "sha1/DmxUShsZuNiqPQsX2Oi9uv2sCnw=")
                      .add(link, "sha1/SXxoaOSEzPC6BgGmxAt/EAcsajw=")
                      .add(link, "sha1/blhOM3W9V/bVQhsWAcLYwPU6n24=")
                      .add(link, "sha1/T5x9IXmcrQ7YuQxXnxoCmeeQ84c=")
                      .build();
  
              client.setCertificatePinner(certificatePinner);
  </code></pre>
  
  <p>Now i have this error:</p>
  
  <pre><code>javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
  </code></pre>