You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accept URIs with scheme, add default SSL options for https, deprecate URLs without scheme (#357)
* Accept URIs with scheme, add default SSL options for https, deprecate URLs without scheme
This commit changes how addresses are handled by GRPC.Stub.connect/2.
First, by accepting URIs with scheme. Before, `http://localhost:50051" would
cause a crash.
Second, by using the URI scheme to automatically set a GRPC credential if no
GRPC credentials were provided. If we were to remove this part, we could at
least validate that a GRPC credential was provided when the scheme is https.
Finally, by deprecating receiving URLs without scheme, such as `localhost:50051`.
This isn't strictly necessary, but in my opinion makes things more consistent when
we want to support both local sockets and remote urls.
* Remove superflous guards
* Improve error message
* Update lib/grpc/stub.ex
* Compute default ssl option in compile_time
Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
* format
* Fix mistake
* Add error when trying to use :cred with http
* Minor fixes/improvements
* Test for opening channels with ips, restructure channel test suite
* Fix typespec for connect/2
* Update lib/grpc/stub.ex
* Add scheme in all non-unix socket connect/2 calls
Makes all examples in the documentation include `http` or `https`.
Changes tests to avoid using deprecated code.
* Revert "Add scheme in all non-unix socket connect/2 calls"
This reverts commit ec02a94.
* Remove deprecation warning
* Apply suggestions from code review
---------
Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
0 commit comments