Giter Club home page Giter Club logo

Comments (2)

linuxmail avatar linuxmail commented on June 19, 2024

hi,

I tried to add debug .. and added to ./lib/puppet_x/consul/acl_base.rb

  module PuppetX::Consul::ACLBase
    class BaseClient
      def initialize(hostname, port, protocol, api_token = nil)
        @global_uri = URI("#{protocol}://#{hostname}:#{port}/v1/acl")
        @http_client = Net::HTTP.new(@global_uri.host, @global_uri.port)
        @http_client.use_ssl = true if @global_uri.instance_of? URI::HTTPS
        @api_token = api_token
        puts @global_uri
      end

...

to see, what is called .. and the printed URL is correct .. than I tried to use the Ruby from Puppet ..

require "net/https"
require "uri"

uri = URI.parse("https://linode-ffm-hashi-server-01.sandbox.example.com:8501/v1/acl")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER

request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
puts response.body

and the output:

Traceback (most recent call last):
	6: from /root/test.ry:11:in `<main>'
	5: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/net/http.rb:1458:in `request'
	4: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/net/http.rb:909:in `start'
	3: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
	2: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/net/http.rb:985:in `connect'
	1: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/net/protocol.rb:44:in `ssl_socket_connect'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) (OpenSSL::SSL::SSLError)

which is exactly the same .. I get with Puppet :-)

Consul config has:

    "ca_file": "/etc/ssl/acme/fullchain.pem",
    "cert_file": "/etc/ssl/acme/fullchain.pem",
     "key_file": "/etc/ssl/acme/privkey.pem"

after playing a lot .. and searching .. I've found the root cause: Puppet 6 on Debian brings

/opt/puppetlabs/puppet/bin/ruby -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]

So, I've upgraded to Puppet7

root@linode-ffm-hashi-server-01:[/etc/apt/sources.list.d]: /opt/puppetlabs/puppet/bin/ruby -v
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]

and ...

root@linode-ffm-hashi-server-01:[/etc/apt/sources.list.d]:  /opt/puppetlabs/puppet/bin/ruby /root/test.ry 
Invalid URL path: not a recognized HTTP API endpoint

Success !

Now, also Puppet runs fine and does not drop anymore issues.

from puppet-consul.

linuxmail avatar linuxmail commented on June 19, 2024

Upgrading from Puppet6 to Puppet7 fixed the issue with LetsEncrypt certificates.

from puppet-consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.