title: How Send SSL Certificate With Java HttpURLConnection
body: <p>I want to send something.crt with HttpURLConnection.</p>
  
  <p>It always says something like:</p>
  
  <blockquote>
    <p>javax.net.ssl.SSLException: Received fatal alert: unexpected_message</p>
    
    <p>String requestURL = "<a href="https://some.thing.com:5874/SomeService/OperationsEndpoint1" rel="nofollow">https://some.thing.com:5874/SomeService/OperationsEndpoint1</a>";</p>
    
    <p>HttpsURLConnection connection = (HttpsURLConnection) new </p>
    
    <p>URL(requestURL).openConnection();</p>
    
    <p>connection.setRequestMethod("POST");</p>
    
    <p>String httpCode = connection.getResponseCode();</p>
    
    <p>String responseMessage = connection.getResponseMessage();</p>
  </blockquote>