title: Errors with SSL validation in Grails
body: <p>I want to make a post to an url with SSL validation in Grails.
  I've imported the certificates, and I've generated the jks files.
  But it seems Grails does not found those jks files.
  Below is the code I'm executing (it's in a Grails Service Class):</p>
  
  <pre><code>def certificate = "mycert.jks"
  
  def http = new HTTPBuilder(url)
  
  def keyStore = KeyStore.getInstance(KeyStore.defaultType)
  getClass().getResource(certificate).withInputStream {
      keyStore.load(it, "test1234".toCharArray())
  }
  
  http.client.connectionManager.schemeRegistry.register(new Scheme("https", new SSLSocketFactory(keyStore), 443))
  </code></pre>
  
  <p>The error is 
  "Cannot invoke method withInputStream() on null object"
  so
  the method getResource() is not working, and returns null.</p>
  
  <p>I saw that this code, in a functionalTest Class, works fine.</p>
  
  <p>Anyone knows how can I solve this problem?</p>
  
  <p>Thanks!!!!!!!</p>