<isene>
Hmm.. it seems it doesn't cause me any issues - I have an issue that I'm wrestling with, and I thought this could be an issue but it's not. Thanks for the input regarding pry and fileutils, though - I didn't know that
nchambers has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
<isene>
I have a mail fetch script that has run more than 5 million times without a hickup. Now as I upgraded from Ubuntu 18.04 to 18.10 (with Ruby 2.5), I get this when trying to login to a remote (gmail) server:
<isene>
from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
Some-body_ has joined #ruby
DarthGandalf has quit [Ping timeout: 264 seconds]
Some-body_ is now known as DarthGandalf
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
uplime has quit [Ping timeout: 250 seconds]
<havenwood>
isene: Did you add your self-signed cert .crt to /usr/local/share/ca-certificates and c_rehash or whatever?
<havenwood>
isene: Normally you'd install the update-ca-certificates package to update certs, but looks like you're using a self signed one?
<isene>
havenwood: I'm clueless in this - my script has worked just nicely before and now it fails... baby steps please?
cnsvc_ has joined #ruby
<havenwood>
isene: So this isn't a Ruby issue, but your OS has a list of certs it trusts. There's an apt package called update-ca-certificates that folk usually use to update trusted certs.
<isene>
There is no package called update-ca-certificates on Ubuntu 18.10 :-/
<isene>
And also; ca-certificates is already the newest version (20180409)
<havenwood>
isene: That's what I meant, ca-certificates.
<havenwood>
(I forgot the package name.)
<isene>
:-)
lytol has quit [Remote host closed the connection]
<isene>
So, how do I fix the error that my script encounters, then?
<havenwood>
isene: In your case, an up-to-date list of trusted certs doesn't help, because it's balking at a self-signed cert.
<havenwood>
isene: "certificate verify failed (self signed certificate)"
<havenwood>
isene: So it's up to you to trust your own cert.
<isene>
Do I need that to login to gmail?
<isene>
Or how do I make me trust my cert here?
<isene>
"me" as in "my system"
<havenwood>
isene: It's pretty offtopic for this channel, but the good folk in #ubuntu can probably guide you.
<havenwood>
isene: Generally, try `apropos certificates`, and then check any manpages that seem relevant. Like: man update-ca-certificates
cthulchu has quit [Ping timeout: 245 seconds]
<havenwood>
isene: It's likely put a cert in a folder then run a command. I don't recall offhand or I'd just say.
<havenwood>
isene: Or you're not supposed to be using a self-signed cert. That's another possibility, but the reason Ruby is balking is it doesn't know about this cert.
<havenwood>
isene: I see you mention Gmail, which makes me think something is amiss with a self-signed cert.
<havenwood>
isene: Check the cert outside Ruby, but it's likely a system problem rather than Ruby-related.
<isene>
Thanks for trying to help me here... So, how can I check the cert outside Ruby?
samort7 has quit [Read error: Connection reset by peer]
\void has quit [Quit: So long, and thanks for all the fish.]
prestorium has joined #ruby
eminencehc has joined #ruby
bjpenn has quit [Ping timeout: 244 seconds]
jottr has joined #ruby
eminencehc has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
DTZUZO has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
Dbugger has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
irdr has quit [Remote host closed the connection]
Dreamer3_ has joined #ruby
irdr has joined #ruby
wolfshappen has quit [Ping timeout: 250 seconds]
wolfshappen has joined #ruby
clemens3_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
prestorium has quit [Quit: prestorium]
prestorium has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
jsc has joined #ruby
jsc is now known as status402
dbz has joined #ruby
clemens3_ has quit [Ping timeout: 246 seconds]
dbz has quit [Ping timeout: 244 seconds]
prestorium has quit [Quit: prestorium]
prestorium has joined #ruby
tiff has joined #ruby
jottr has joined #ruby
tiff has quit [Client Quit]
Dbugger has quit [Quit: Leaving]
reber has quit [Remote host closed the connection]
ixti has quit [Quit: WeeChat 2.3]
jottr has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
phaul has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
elphe has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
m0w has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
neuraload has joined #ruby
status402_ has joined #ruby
status402 has quit [Read error: Connection reset by peer]
conta has joined #ruby
mikecmpbll has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
neuraload has quit [Quit: This computer has gone to sleep]
elphe has joined #ruby
jottr has joined #ruby
jottr has quit [Client Quit]
za1b1tsu has quit [Ping timeout: 250 seconds]
neuraload has joined #ruby
conta has quit [Quit: conta]
cnsvc_ has quit [Ping timeout: 256 seconds]
dhollin3 has joined #ruby
dhollinger has quit [Ping timeout: 250 seconds]
jthomas1 has joined #ruby
<isene>
back to the issue at hand after a night's sleep; Anyone knows how to ensure Ruby looks for certificates in the correct place?
jthomas1 has quit [Ping timeout: 246 seconds]
Guest49234 has joined #ruby
neuraload has quit [Ping timeout: 240 seconds]
neuraload has joined #ruby
cnsvc_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
nickjj has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
ellcs has joined #ruby
neuraload has quit [Ping timeout: 245 seconds]
neuraload has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
trif has joined #ruby
trif has quit [Client Quit]
trif has joined #ruby
trif has quit [Client Quit]
<Iambchop>
isene: are you using ubuntu's packaged, build your own, 3rd party package? you used imap.gmail.com:993 on your s_client test? the line you said it's failing on "imap.gmail.com" isn't in the script you posted (ms[0][0] is in the script). test with just a minimal example e.g. $ ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)'
eminencehc has joined #ruby
neuraload has quit [Quit: This computer has gone to sleep]
Guest78161 has joined #ruby
trif has joined #ruby
eminencehc has quit [Ping timeout: 272 seconds]
neuraload has joined #ruby
dbz has joined #ruby
trif has quit [Quit: leaving]
trif has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
ellcs has quit [Ping timeout: 250 seconds]
dbz has quit [Remote host closed the connection]
neuraload has quit [Quit: This computer has gone to sleep]
trif has quit [Quit: leaving]
deathwishdave has joined #ruby
trif has joined #ruby
trif has quit [Client Quit]
AJA4350 has joined #ruby
trif has joined #ruby
themsay has quit [Ping timeout: 244 seconds]
paranoicsan has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
neuraload has joined #ruby
lucasb has joined #ruby
elphe has joined #ruby
trif has quit [Quit: leaving]
trif has joined #ruby
neuraload has quit [Quit: This computer has gone to sleep]
rippa has joined #ruby
DTZUZO has joined #ruby
neuraload has joined #ruby
neuraload has quit [Client Quit]
ellcs has joined #ruby
Guest49234 has quit [Ping timeout: 250 seconds]
Guest49234 has joined #ruby
Guest49234 has quit [Ping timeout: 268 seconds]
ellcs has quit [Ping timeout: 252 seconds]
neuraload has joined #ruby
neuraload has quit [Quit: Leaving]
Guest49234 has joined #ruby
Guest49234 has quit [Ping timeout: 250 seconds]
paranoicsan is now known as paranoicsan[Away
nickjj has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
nickjj has joined #ruby
paranoicsan[Away is now known as paranoicsan
paranoicsan has quit [Quit: paranoicsan]
kapil____ has quit [Quit: Connection closed for inactivity]
dhollin3 is now known as dhollinger
jthomas1 has joined #ruby
kapil____ has joined #ruby
jthomas1 has quit [Ping timeout: 244 seconds]
Guest49234 has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
Guest49234 has quit [Ping timeout: 246 seconds]
<marz_d`ghostman>
Does Logger automatically capture stderr and stdout if you set it to FATAL?
conta has joined #ruby
bmurt has joined #ruby
Guest49234 has joined #ruby
cnsvc_ has joined #ruby
Inline has joined #ruby
Guest78161 has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
nowhere_man has joined #ruby
roshanavand has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
ua has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
connermcd has joined #ruby
ua has joined #ruby
Guest49234 has quit [Ping timeout: 244 seconds]
Guest49234 has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
neuraload has joined #ruby
Arkantos has joined #ruby
jcalla has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
status402_ has quit [Quit: status402_]
chouhoulis has quit [Ping timeout: 246 seconds]
DTZUZO has joined #ruby
postmodern has quit [Quit: Leaving]
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
Rapture has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
<isene>
OK, I have checked and verified left, right & center. This is a Ruby specific issue with my setup after upgrading from Ubuntu 18.04 to 18.10. It seems some package was broken, but I don't understand which (or if there is another Ruby issue relating to upgrade to 2.5). Here's my testing results:
<isene>
Checking with openssl raw ' openssl s_client -showcerts -connect imap.gmail.com -port 993 ' all certs checks out with verify=1
<isene>
I have tested logging in with the correct username/pw with Python, all ok
<isene>
But when I do this simple thing in irb/pry:
<isene>
from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock'
<isene>
There is no issue with the certificates (as verified with openssl and python). It may be that Ruby is looking for certificates in the wrong place or something?
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
venmx has joined #ruby
<isene>
As you see, I don't even get to logging in to gmail with un/pw - as it fails on connect
<isene>
lambarena: ^^
<phaul>
you could try scanning through strace of pry vs python. Looking for paths they open for certs. It's a long shot but it could prove you right, or give more hints
<KrzaQ>
In my case I wanted to get a proper value, but anything that would allow me getting a point-free chain would be preferred over wrapping the chain in parens or naming variables
<KrzaQ>
:P
darkhanb has joined #ruby
<phaul>
point free brings back memories from my haskell days
<phaul>
ppl also called it pointless style :)
<nchambers>
haha
<KrzaQ>
I would say it makes for very clear intent if you're doing just data manipulation and can fit it short code
<KrzaQ>
I guess I can yield_self on the array to avoid polluting the scope
dbz has joined #ruby
aupadhye has quit [Quit: Leaving]
<marz_d`ghostman>
Can someone suggest a good article or book about threads in ruby like how to capture its stdout and stderr.
<havenwood>
marz_d`ghostman: Your gist link is 404ing. What did you try?
<havenwood>
KrzaQ: yeah, I usually think Hash with #fetch too. you're welcome.
<havenwood>
I do think #fetch is generally underused. With ENV too.
<KrzaQ>
I use it quite a lot, actually, but rarely with arrays
akaiiro has joined #ruby
* havenwood
nods
<havenwood>
same
<KrzaQ>
recent advent of code made me wish for array fetch that wouldn't interpret negative indices
Dbugger has joined #ruby
<KrzaQ>
I mean, it was trivial to monkey patch it into the class, but I would prefer not having to do that (and not doing it outside of a toy puzzle code)
m0w has joined #ruby
Renich has quit [Ping timeout: 250 seconds]
DTZUZO has quit [Ping timeout: 244 seconds]
neuraload has quit [Quit: This computer has gone to sleep]
Renich has joined #ruby
cthulchu_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
neuraload has joined #ruby
Nicmavr has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
bmurt has joined #ruby
dbz has quit [Remote host closed the connection]
brendan- has joined #ruby
GodFather has quit [Ping timeout: 264 seconds]
reber has joined #ruby
venmx has quit [Quit: leaving]
venmx has joined #ruby
orbyt_ has joined #ruby
spacesuitdiver has joined #ruby
Mike11 has quit [Ping timeout: 250 seconds]
maryo has quit [Remote host closed the connection]
maryo has joined #ruby
venmx has quit [Ping timeout: 250 seconds]
sauvin has quit [Remote host closed the connection]
neuraload has quit [Quit: This computer has gone to sleep]
<havenwood>
KrzaQ: what should the return value be for a negative index?
<KrzaQ>
in the case I wanted? nil, basically I wanted to build a grid out of arrays, and to cut the edge cases by having out-of-bounds access return nil
salasrod has quit [Quit: /quit]
salasrod has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maryo has quit [Ping timeout: 272 seconds]
cnsvc_ has joined #ruby
Chew has quit [Quit: Connection closed for inactivity]
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
\void has quit [Quit: So long, and thanks for all the fish.]
\void has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
spacesui_ has joined #ruby
deathwishdave has joined #ruby
deathwishdave has quit [Client Quit]
spacesuitdiver has quit [Ping timeout: 240 seconds]
tjarvis has joined #ruby
connermcd has quit [Quit: WeeChat 2.3]
Dbugger has quit [Remote host closed the connection]
za1b1tsu has quit [Remote host closed the connection]
twobitsprite has quit [Ping timeout: 250 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
onkelhotte has joined #ruby
dbz has joined #ruby
<isene>
phaul: I'm back. And with a bit more research it seems that Ruby is looking for a cert.pem in /usr/lib/ssl/ that doesn't exist (this may be just one of several issues). I tried prging ruby completely and reinstalling it - to no use. wtf?
dellavg_ has quit [Ping timeout: 240 seconds]
dbz has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 240 seconds]
<havenwood>
isene: What's your DEFAULT_CERT_DIR?: ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_DIR"
<havenwood>
isene: If the cert is there, c_rehash that dir.
<havenwood>
isene: See: man c_rehash
roshanavand has quit [Remote host closed the connection]
<ubuntuisloved>
I'm taking over a project with pundit but I cannot seem to figure out how to get my user authorized with it. There are api routes and such but none actually throw up a user auth screen. Any direction you can send me to look for would be very helpful.
<havenwood>
?rails ubuntuisloved
<ruby[bot]>
ubuntuisloved: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
elphe has quit [Ping timeout: 245 seconds]
<ubuntuisloved>
k
<isene>
after yet another update-ca-certificates and the c_rehash I still get the same :-/
<havenwood>
isene: Is the cert you're looking for in /usr/lib/ssl/certs at all?
<havenwood>
Hrm
<isene>
Well, openssl finds it and python runs everything just fine... how do I see if it's there (I'm not well versed in certificates and such)?
onkelhotte has quit [Quit: WeeChat 2.2]
<havenwood>
isene: It'd be one of the .pem files in that dir. You could put it there then c_rehash if it's not there.
<havenwood>
isene: Usually you grab a CA certificate store in .pem format from curl or mozilla that has a whitelist of certificate authority certs. pdate-ca-certificates is the automagical way to do that.
<havenwood>
isene: In my experience it usually *just works* after a: sudo update-ca-certificates
<isene>
So, does that include the imap.gmail.com? You see, this was working just beautifully since 10 years back, and my mail_fetch.rb has been running more than 5 million time since then without a glitch. No stuff is wrecked.
<isene>
*Now
<isene>
And it DOES work with openssl and with Python, and That is what drives me nuts here
spacesuitdiver has quit [Ping timeout: 268 seconds]
<havenwood>
isene: It looks like Gmail used to be configured with a self-signed cert - one that wouldn't be in a cert bundle. Hrm. This isn't my area of expertise so I'm not spotting the issue.
<isene>
But how can openssl and python do this without an issue while ruby balks? mepuzzled
elphe has joined #ruby
<havenwood>
isene: What's the Python equivalent of OpenSSL::X509::DEFAULT_CERT_FILE pointing at?
<isene>
And all of a sudden as a result of upgrading from Ubuntu 18.04 to 18.10
<havenwood>
isene: OS upgrades tend to mess up certs - as ones get dropped and added. :P
<isene>
... that I don't know as I'm totally noob in python. Let me googøe
<isene>
So, it cannot be a certificate issue - it must be a ruby issue :-/
<havenwood>
isene: Does it work if you set: ENV['SSL_CERT_FILE'] = '/etc/ssl/certs/ca-certificates.crt'
<havenwood>
isene: If so, from your shell you can: export SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
<havenwood>
isene: Someone else here might have a cleaner suggestion.
<havenwood>
isene: I'm tempted to say just convert that .crt to a .pem, put it in /usr/lib/ssl/certs and c_rehash
scrooloose has quit [Quit: Connection closed for inactivity]
DTZUZO has joined #ruby
<darix>
seems I have another action items NOTE: Gem::Specification#has_rdoc is deprecated with no replacement. It will be removed on or after 2018-12-01.
Dbugger has joined #ruby
* havenwood
looks at the calendar
<darix>
/etc/ssl/certs/ca-certificates.crt this seems like something wrong when you use update-ca-certificates
<darix>
havenwood: before I can work on this I need to wait for my gitlab package to publish
<isene>
That ENV['SSL_CERT_FILE'] = '/etc/ssl/certs/ca-certificates.crt' did nothing. I will try to copy the .crt file to .pem and do c_rehash
<darix>
you shouldnt have to use c_rehash anymore with a system that uses update-ca-certificates
<darix>
i have the feeling you are mixing a lot of things there
kapil____ has quit [Quit: Connection closed for inactivity]
<isene>
darix: Well, I have tried what seems to be everything under the sun here and still coming up short :-/
<darix>
isene: normally if you use your system ruby and dont configure anything special with your CA certs in your script or any of the gems you are using
<darix>
than ruby (well openssl) should find the system certs automatically
<isene>
darix: I have done that. Works just fine. Python also works just fine. But Ruby goes haywire (see https://isene.org/x/strace.log3)
spacesui_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<darix>
how did you install that ruby?
<isene>
So - it isn't a certificate issue, it is a ruby issue. I do this: ruby -r net/imap -e 'p Net::IMAP.new("imap.gmail.com", 993, ssl: true)' and it reports this: /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate) (OpenSSL::SSL::SSLError)
<darix>
looks like debian or so
spacesuitdiver has joined #ruby
<darix>
works fine with ruby 2.5 on opensuse :P
venmx has joined #ruby
<isene>
Everything worked just fine up until I upgraded from Ubuntu 18.04 to 18.10 yesterday (I mean it has worked more than 5 million times over the past 10 years with script running every minute)
postmodern has joined #ruby
spacesuitdiver has quit [Client Quit]
code_zombie has joined #ruby
<darix>
did you check their bugtracker if it is a known issue?