Skip to content

can falcon be used with client certificate authentication? #268

Answered by ioquatix
graf0 asked this question in General
Discussion options

You must be logged in to vote

Here is a small example for setting up falcon host using a verify_callback:

#!/usr/bin/env falcon-host
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.

require "falcon/environment/self_signed_tls"
require "falcon/environment/rack"
require "falcon/environment/supervisor"

service "hello.localhost" do
	include Falcon::Environment::SelfSignedTLS
	include Falcon::Environment::Rack
	
	scheme "https"
	protocol {Async::HTTP::Protocol::HTTPS}
	
	ssl_context do
		super().tap do |context|
			context.verify_mode = OpenSSL::SSL::VERIFY_PEER
			
			context.verify_callback = proc do |verified, store_context|
				Console.warn(self, "Verified: #{

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ioquatix
Comment options

Answer selected by ioquatix
@ioquatix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants