I’m wondering if I should try using the openssl authentication system I setup with PhunkyBB, in PHP.

I think Ruby has the same openssl capabilities, at least this page seems to suggest so:

And for Sinatra authentication, this looks good: