Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unknown authentication type 'dsa' when setting authentication #72

Merged
merged 1 commit into from
Jan 10, 2017
Merged

Error: Unknown authentication type 'dsa' when setting authentication #72

merged 1 commit into from
Jan 10, 2017

Conversation

raphink
Copy link
Member

@raphink raphink commented Aug 18, 2016

When setting the authentication in Puppet for a ssl_pkey :

ssl_pkey { "${ssl_dir}/${service_name}":
    ensure          => present,
    size            => 2048,
    authentication  => 'dsa',
    password        => 'test'
}

I get the following error : Error: Unknown authentication type 'dsa' when setting authentication

I tried with and without quotes/double quotes.

I use Puppet 3.8.5, with Ruby 1.8.7.

After looking at the code, it seems the comparison is done with a symbol :

  def self.generate_key(resource)
    if resource[:authentication] == :dsa
      OpenSSL::PKey::DSA.new(resource[:size])
    elsif resource[:authentication] == :rsa
      OpenSSL::PKey::RSA.new(resource[:size])
    else
      raise Puppet::Error,
        "Unknown authentication type '#{resource[:authentication]}'"
    end
end

Replacing if resource[:authentication] == :dsa by if resource[:authentication].to_sym == :dsa seems to fix the issue, but I am not sure it is the good way to do things.

@raphink
Copy link
Member

raphink commented Aug 18, 2016

@christophelec just attached some code to the issue. Does that solve your problem?

@raphink
Copy link
Member

raphink commented Nov 7, 2016

@christophelec have you been able to test the provided code?

@christophelec
Copy link
Author

Hello,

Sorry about the delay, it went under my radar. I just tested and it does fix the issue, thanks !

@raphink raphink merged commit a55d191 into voxpupuli:master Jan 10, 2017
@raphink raphink added the bugfix label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants