asciidoctor / asciidoctor-confluence

Push Asciidoctor file to Confluence
https://rubygems.org/gems/asciidoctor-confluence
MIT License
82 stars 28 forks source link

Plugin not works for ssl untrusted certificates #15

Open luismoramedina opened 6 years ago

luismoramedina commented 6 years ago

Hi,

I am getting this error because the ssl certificate is self-signed. Is there a way to disable certificate validation in https/ssl connections?

Error: _An error occurred, the page has not been created because: SSLconnect returned=1 errno=0 state=error: certificate verify failed

Call: asciidoctor-confluence --host https://myconfluence --spaceKey X --title Title --username x --password y README.adoc

Regards and thanks in advance.

maksim77 commented 6 years ago

I have exactly the same problem.

mavanier commented 5 years ago

There is a way to bypass SSL Verification.

I updated bin/asciidoctor-confluence file

#!/usr/bin/env ruby

require 'openssl'
require 'rubygems' if RUBY_VERSION < '1.9'
require File.join File.dirname(__FILE__), '../lib/asciidoctor/confluence/invoker'

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
result_code = Asciidoctor::Confluence::Invoker.invoke ARGV
exit result_code

I still have a warning but it works.

/usr/lib/ruby/gems/2.4.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER

for information, I am using the asciidoctor/docker-asciidoctor docker image.

Sergey-Zorin commented 4 years ago

I prepared PR https://github.com/asciidoctor/asciidoctor-confluence/pull/24 to solve this problem