{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/300","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/300/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/300/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/300","id":45078699,"number":300,"title":"Make SSL checks lenient for faulty HTTPS certificates","user":{"login":"kr428","id":685879,"avatar_url":"https://avatars.githubusercontent.com/u/685879?v=3","gravatar_id":"","url":"https://api.github.com/users/kr428","html_url":"https://github.com/kr428","followers_url":"https://api.github.com/users/kr428/followers","following_url":"https://api.github.com/users/kr428/following{/other_user}","gists_url":"https://api.github.com/users/kr428/gists{/gist_id}","starred_url":"https://api.github.com/users/kr428/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kr428/subscriptions","organizations_url":"https://api.github.com/users/kr428/orgs","repos_url":"https://api.github.com/users/kr428/repos","events_url":"https://api.github.com/users/kr428/events{/privacy}","received_events_url":"https://api.github.com/users/kr428/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-10-07T07:55:21Z","updated_at":"2016-03-15T00:37:33Z","closed_at":"2014-12-24T04:23:40Z","body":"Testing swagger codegen against a service provided by one of our partners, I fail because the HTTPS certificate used in their testbed environment obviously doesn't really match their DNS hostname:\r\n\r\n```java\r\njava.lang.reflect.InvocationTargetException\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat scala_maven_executions.MainHelper.runMain(MainHelper.java:164)\r\n\tat scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)\r\nCaused by: java.lang.Exception: unable to read from https://lab.xx.yyy.com/api/core\r\n\tat com.wordnik.swagger.codegen.BasicGenerator.generateClientWithoutExit(BasicGenerator.scala:62)\r\n\tat com.wordnik.swagger.codegen.BasicGenerator.generateClient(BasicGenerator.scala:47)\r\n\tat com.wordnik.swagger.codegen.BasicJavaGenerator$.main(BasicJavaGenerator.scala:22)\r\n\tat com.wordnik.swagger.codegen.BasicJavaGenerator.main(BasicJavaGenerator.scala)\r\n\t... 6 more\r\nCaused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching lab.xx.yyy.com found.\r\n\tat sun.security.ssl.Alerts.getSSLException(Alerts.java:192)\r\n\tat sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)\r\n\tat sun.security.ssl.Handshaker.fatalSE(Handshaker.java:301)\r\n\tat sun.security.ssl.Handshaker.fatalSE(Handshaker.java:295)\r\n\tat sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1369)\r\n\tat sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:156)\r\n\tat sun.security.ssl.Handshaker.processLoop(Handshaker.java:925)\r\n\tat sun.security.ssl.Handshaker.process_record(Handshaker.java:860)\r\n\tat sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043)\r\n\tat sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)\r\n\tat sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)\r\n\tat sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)\r\n\tat sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)\r\n\tat sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)\r\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)\r\n\tat com.wordnik.swagger.codegen.util.RemoteUrl$class.urlToString(RemoteUrl.scala:30)\r\n\tat com.wordnik.swagger.codegen.util.ResourceExtractor$.urlToString(ResourceExtractor.scala:27)\r\n\tat com.wordnik.swagger.codegen.util.ResourceExtractor$.fetchListing(ResourceExtractor.scala:30)\r\n\tat com.wordnik.swagger.codegen.BasicGenerator.generateClientWithoutExit(BasicGenerator.scala:60)\r\n\t... 9 more\r\nCaused by: java.security.cert.CertificateException: No subject alternative DNS name matching lab.xx.yyy.com found.\r\n\tat sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:191)\r\n\tat sun.security.util.HostnameChecker.match(HostnameChecker.java:93)\r\n\tat sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455)\r\n\tat sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436)\r\n\tat sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:200)\r\n\tat sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)\r\n\tat sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1351)\r\n\t... 25 more\r\n```\r\n\r\nThis seems an issue not too uncommon (see [1] in example), but the solutions in here aren't applicable to me as I can't do anything about the certificate used here and I don't right now want to hack into the code generator to apply any of the Java based solutions (like the one outlined in [1]). \r\n\r\nWould it be possible to introduce a parameter to codegen to ignore SSL errors like this?\r\n\r\n[1] https://stackoverflow.com/questions/19540289/how-to-fix-the-java-security-cert-certificateexception-no-subject-alternative"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/196586730","html_url":"https://github.com/swagger-api/swagger-codegen/issues/300#issuecomment-196586730","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/300","id":196586730,"user":{"login":"panih2o","id":1556625,"avatar_url":"https://avatars.githubusercontent.com/u/1556625?v=3","gravatar_id":"","url":"https://api.github.com/users/panih2o","html_url":"https://github.com/panih2o","followers_url":"https://api.github.com/users/panih2o/followers","following_url":"https://api.github.com/users/panih2o/following{/other_user}","gists_url":"https://api.github.com/users/panih2o/gists{/gist_id}","starred_url":"https://api.github.com/users/panih2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panih2o/subscriptions","organizations_url":"https://api.github.com/users/panih2o/orgs","repos_url":"https://api.github.com/users/panih2o/repos","events_url":"https://api.github.com/users/panih2o/events{/privacy}","received_events_url":"https://api.github.com/users/panih2o/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T00:37:33Z","updated_at":"2016-03-15T00:37:33Z","body":"@fehguy Could you please tell how to disable certificate verification in swagger codegen?"}}