swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

Swagger online validator is not able to validate, even it's public URL #57

Closed ajainy closed 8 years ago

ajainy commented 8 years ago

This is code being used on HTML page

<span>
 <a href="http://online.swagger.io/validator/debug?url=https://snapcx.io/api/swagger.json">
    <img id="validator" src="http://online.swagger.io/validator?url=https://snapcx.io/api/swagger.json">
 </a>
</span>

And I checked, "https://snapcx.io/api/swagger.json" is public.

No idea, why I am seeing this error,

[{"level":"error","message":"Can't read from file https://snapcx.io/api/swagger.json"}]

webron commented 8 years ago

It looks like there's a problem with the ssl handshake, but I can't really figure out the issue yet.

ajainy commented 8 years ago

ValidatorService seems to be disabling any SSL checks. SSL layer is provided by cloudflare, in this case. You can do "curl -v https://snapcx.io/api/swagger.json" .. for detailed report.

kleisauke commented 8 years ago

Same problem here, I'm also using CloudFlare for the SSL layer. URL: https://api.rocrooster.net/api-docs.json

fehguy commented 8 years ago

A PR would be great here.

kleisauke commented 8 years ago

After a quick look in the source: Maybe replace SSLContext.getInstance("SSL"); with SSLContext.getInstance("TLS"); (here) because CloudFlare's SSL Layer supports only the following protocols: TLS 1.0, TLS 1.1, TLS 1.2 (according to this).

kleisauke commented 8 years ago

A pull request has been made for this issue, see: #61

webron commented 8 years ago

Closed as #61 has been merged. Thanks for the PR, @kleisauke!