Skip to content

SSL peer certificate error in localhost #435

@vzelenko

Description

@vzelenko

Hi, I'm trying to use the library for local testing, and it is consistently failing with:

Error retrieving forms: SSL peer certificate or SSH remote key was not OK
HTTP status code: 0

The code used:

    api_key = ENV["HUBSPOT_API_KEY"]
    client = Hubspot::Client.new(
      access_token: api_key,
      debugging: true,
      logger: $stdout
    )


    begin
      # This uses the specific Marketing Forms API client
      data, status_code, headers = client.marketing.forms.forms_api.get_by_id_with_http_info(form_id: "<FORM ID>")
      puts "Form: #{data.inspect}, Status: #{status_code}, Headers: #{headers.to_json}   <=== "

    rescue => e
      puts "Error retrieving forms: #{e.message}"
    end

Any way to overcome it? I am able to get the response with basic Net::HTTP request when use_ssl = true, and Postman as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions