Skip to content

Commit a419660

Browse files
committed
added friendly error message when SSL validation fails
1 parent e7eedcf commit a419660

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/scala/com/wordnik/swagger/codegen/util/RemoteUrl.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ trait RemoteUrl {
3030
is = conn.getInputStream()
3131
Source.fromInputStream(is).mkString
3232
}
33+
catch {
34+
case e: javax.net.ssl.SSLProtocolException => {
35+
println("there is a problem with the target SSL certificate")
36+
println("**** you may want to run with -Djsse.enableSNIExtension=false\n\n")
37+
e.printStackTrace
38+
throw e
39+
}
40+
case e: Exception => e.printStackTrace; throw e;
41+
}
3342
finally {
3443
if(is != null) is.close()
3544
}

0 commit comments

Comments
 (0)