Skip to content

Setting use_ssl to false without changing ssl_options causes a crash #178

@dantswain

Description

@dantswain

From this section of the config:

  # This is the flag that enables use of ssl
  use_ssl: true,
  # see SSL OPTION DESCRIPTIONS - CLIENT SIDE at http://erlang.org/doc/man/ssl.html
  # for supported options
  ssl_options: [
    cacertfile: System.cwd <> "/ssl/ca-cert",
    certfile: System.cwd <> "/ssl/cert.pem",
    keyfile: System.cwd <> "/ssl/key.pem",
  ],

I would expect that setting use_ssl to false will simply make ssl_options irrelevant. Instead it causes the application to fail to start with a

** (Mix) Could not start application kafka_ex: KafkaEx.start(:normal, []) returned an error: :badarg

which is pretty unhelpful.

I propose:

  1. If use_ssl is set to false, the application should ignore ssl_options.
  2. If anything in ssl_options is configured incorrectly, the application should raise a meaningful error to guide the user in determining what is wrong.

Metadata

Metadata

Assignees

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