HTTP/HTTPS basic authentication: colon in username

the RFC https://www.rfc-editor.org/rfc/rfc2617#section-2 states clearly that the username must not include a colon: To receive authorization, the client sends the userid and password, separated by a single colon (“:”) character, within a base64 [7] encoded string in the credentials.` basic-credentials = base64-user-pass base64-user-pass = <base64 [4] encoding of user-pass, except not limited to 76 char/line> … Read more

Pass cert password to Nginx with https site during restart

Nginx has ssl_password_file parameter. Specifies a file with passphrases for secret keys where each passphrase is specified on a separate line. Passphrases are tried in turn when loading the key. Example: http { ssl_password_file /etc/keys/global.pass; … server { server_name www1.example.com; ssl_certificate_key /etc/keys/first.key; } server { server_name www2.example.com; # named pipe can also be used instead … Read more

How can I “login” to git?

You don’t login to Git. You do login to a Git repository hosting server, which request an authentication, but Git itself has no authentication nor authorization. (As an example of Git repository hosting service offering login: GitHub: gh auth login GitLab: glab auth login) What Git does have is credential caching (check the output of … Read more

Rails redirect with https

The ActionController::Base#redirect_to method takes an options hash, one of the parameters of which is :protocol which allows you to call: redirect_to :protocol => ‘https://’, :controller => ‘some_controller’, :action => ‘index’ See the definition for #redirect_to and #url_for for more info on the options. Alternatively, and especially if SSL is to be used for all your … Read more

Ruby https POST with headers

The problem it was a json. This solve my problem. Anyway, my question was not clear, so the bounty goes to Juri require ‘uri’ require ‘net/http’ require ‘net/https’ require ‘json’ @toSend = { “date” => “2012-07-02”, “aaaa” => “bbbbb”, “cccc” => “dddd” }.to_json uri = URI.parse(“https:/…”) https = Net::HTTP.new(uri.host,uri.port) https.use_ssl = true req = Net::HTTP::Post.new(uri.path, … Read more