heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
214 stars 85 forks source link

Create Sni endpoint error #130

Closed starverdiyev closed 2 years ago

starverdiyev commented 2 years ago

Hello,

Use heroku_client.domain.create to create custom domains for review apps, but faced with error:

{"id"=>"invalid_params", "message"=>"Require params: sni_endpoint."}

After checked, see that this is new heroku requirement from 2021 years

In source code of this repository find heroku_client.sni_endpoint.create. But i faced with new error:)

heroku_client.sni_endpoint.create(heroku_app_name, hostname: "example.com")

=> {"id"=>"invalid_params", "message"=>"Require params: certificate_chain, private_key."}

What I do wrong?) Thank you!

mikehale commented 2 years ago

Hi, If you want to create a domain you now need to specify an sni_endpoint param, but it can be null: heroku_client.domain.create(hostname: "example.com", sni_endpoint: null). See https://devcenter.heroku.com/articles/platform-api-reference#domain-create for reference.

If you want to have a custom cert on your app you will need to pass in a certificate and key: heroku_client.sni_endpoint.create(heroku_app_name, hostname: "example.com", certificate_chain: "chain data", private_key: "key data"). See https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint-create for reference.

starverdiyev commented 2 years ago

@mikehale yes thanks, I found a solution, but not null, it must be nil: sni_endpoint: nil