nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

Use conversion protocol to ensure input types on connection init #142

Closed witkwski closed 7 years ago

witkwski commented 7 years ago

Protect borders :shield: earlier then it will be passed to SSL with few extra characters. Fixed double quotes in README.

dankimio commented 7 years ago

@witkwski why do we need to convert certificate data to a string here? When can it be something other that a string?

witkwski commented 7 years ago

@dankimio for example? OpenSSL::X509::Certificate#new expects a string as a certificate and coerces input data to be a string . OpenSSL::PKey::RSA#new in that case expects a pair of strings as well (cert and passphrase). So will be better to ensure needed types on connection building instead of catching errors from OpenSSL entrails.

dankimio commented 7 years ago

@witkwski That's a valid point! Thank you for the PR.