-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError: undefined method `ssl_in_use?' for #<PG::Connection:0x007fc19b3bf308> #263
Comments
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). The SSL functions in pg require PostgreSQL version 9.5 or newer. See the |
Original comment by Brett Herford-Fell (Bitbucket: brettskiii, GitHub: brettskiii). OK cool, would it be easier to return "unsupported PostgreSQL version" or something because the methods not being there is kind of confusing |
Original comment by Brett Herford-Fell (Bitbucket: brettskiii, GitHub: brettskiii). OK thank you. |
Original comment by Daya Sharma (Bitbucket: daya, GitHub: daya). Since the method is not implemented As a side note I would like to understand the purpose of documenting the method when its not actually implemented or at least is not accessible in PG gem. FYI, I am using PG gem 0.21.0 and PostgreSQL 9.6.4 with Rails 5.0.1 Thanks for your help Michael. |
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Correct, there are no other reliable ways via the client library to check for the use of SSL that'll work before 9.5. You can check whether or not OpenSSL in particular is in use by calling
It is accessible if your underlying Postgres client library is recent enough. E.g.,:
Since Ruby already has a means of introspection to check for the availability of a method ( |
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). If the client side SSL methods aren't available, it's still possible to use the server side functions. They are available in all maintained PostgreSQL versions: https://www.postgresql.org/docs/9.2/static/sslinfo.html I already added version information to methods on the master branch. |
Original report by Brett Herford-Fell (Bitbucket: brettskiii, GitHub: brettskiii).
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
PG 0.20.0 (build 838985377b48)
Server version: 90304
Client version: 90314
NoMethodError: undefined method `ssl_in_use?' for #PG::Connection:0x007fc19b3bf308
Does this method exist / should it? It's in the docs but not in the gem?
The text was updated successfully, but these errors were encountered: