title: SSLPeerUnverifiedException (Unirest)
body: <p>I'm new to messing around with APIs (both official and unofficial) and I'm using one called <a href="https://github.com/hatboysam/JavaSnap" rel="nofollow">JavaSnap</a>. I've  been messing around with a very basic implementation of the example code, but have been running into errors. Here is the very basic code:</p>
  
  <pre><code>Snapchat snapchat = Snapchat.login("xxxx", "xxxxx");
  </code></pre>
  
  <p>Firstly I ran into loads of ClassNotFound errors and had to keep on downloading apache modules (commons, httpcomponents etc.) to allow the program to progress, but being class files this meant I couldn't see all at once what modules I needed to download. So if anyone wants to tell me how wrong I'm doing something feel free.</p>
  
  <p>Anyway, now having cleared up all the ClassNotFound exceptions (I hope) I'm getting the following exception:</p>
  
  <pre><code>com.mashape.unirest.http.exceptions.UnirestException: javax.net.ssl.SSLPeerUnverifiedException: Host name 'feelinsonice-hrd.appspot.com' does not match the certificate subject provided by the peer (CN=*.appspot.com, O=Google Inc, L=Mountain View, ST=California, C=US)
      at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:146)
      at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
      at com.habosa.javasnap.Snapchat.requestJson(Snapchat.java:953)
      at com.habosa.javasnap.Snapchat.login(Snapchat.java:160)
      at Tester.go(Tester.java:21)
  </code></pre>
  
  <p>As I understand it, this is because I need to enable trusting all certificates, however to do this I believe I'd need to use HostNameVerifiers with SSLSocketFactorys, but I can't really begin to mess around with this as I only have the source for the JavaSnap API, and tracing the error up the stack the most recent method available for me to edit is this:</p>
  
  <pre><code>private static HttpResponse&lt;JsonNode&gt; requestJson(String path, Map&lt;String, Object&gt; params, File file) throws UnirestException {
          MultipartBody req = prepareRequest(path, params, file);
  
          // Execute and return response as JSON
          HttpResponse&lt;JsonNode&gt; resp = req.asJson();
  
          // Record
          lastRequestPath = path;
          lastResponse = resp;
          lastResponseBodyClass = JsonNode.class;
  
          return resp;
  </code></pre>
  
  <p>My question is, am I actually on the right lines with my thinking? <br>If I am how can I achieve my goal of eliminating this error / trusting certificates? If I'm not then what in fact is the problem?</p>
  
  <p>Thanks very much</p>