Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Run Ruby applications in FIPS mode on Red Hat Enterprise Linux

November 28, 2025
Jun Aruga
Related topics:
Programming languages & frameworksSecuritySecure coding
Related products:
Red Hat Enterprise Linux

    Cryptographic standards can be complex, especially if you need to ensure your applications meet Federal Information Processing Standards (FIPS) requirements. This article shows you how to run applications written in Ruby in FIPS mode on Red Hat Enterprise Linux (RHEL). 

    RHEL supports FIPS mode in system level, and Ruby can operate in this mode through its standard library, Ruby OpenSSL (the openssl gem). I'll provide insights and instructions, with examples from Red Hat Enterprise Linux 10, based on my contributions to the upstream Ruby project.

    Behind the scenes: My upstream contribution for FIPS

    For a while now, I've been working to ensure that Ruby plays nicely with the OpenSSL FIPS module. My contribution to the upstream Ruby OpenSSL project for FIPS started when a FIPS-specific bug was identified in Ruby OpenSSL. I noticed its continuous integration (CI) tests were missing FIPS-specific coverage.

    To address this gap and help make Ruby more secure for everyone, I proposed becoming a co-maintainer of the Ruby OpenSSL project, focusing on FIPS. The Ruby project approved my proposal, and I have been contributing to this effort ever since. Working with the Ruby project has been a great learning experience, and I am grateful for the kindness and guidance of the Ruby project members and contributors.

    Recommended RHEL and Ruby versions for FIPS mode

    For the best experience running Ruby in RHEL FIPS mode, consult the recommended combinations of RHEL and Ruby versions. While upstream Ruby OpenSSL versions 3.2.0 and later fully support FIPS mode, Red Hat has applied patches to earlier Ruby OpenSSL versions in RHEL to improve FIPS mode functionality.

    The following table provides the recommended RHEL and Ruby version combinations.

    RHELApplication streamApplication stream release dateApplication stream retirement dateApplication stream releaseRecommended RHEL and Ruby versions
    RHEL 10Ruby 3.3May 2025N/A10.0All recommended
    RHEL 9Ruby 3.3May 2024Mar 20279.4All recommended
    RHEL 9Ruby 3.0May 2022N/A9.0RHEL: 9.4 or later; Ruby: ruby-3.0.4-161.el9 or later
    RHEL 8Ruby 3.3May 2024Mar 20278.10All recommended
    RHEL 8Ruby 2.5May 2019N/A8.0.0All recommended

    Confirming your FIPS environment

    Before you begin, ensure your RHEL system is running in FIPS mode.

    Next, install the Ruby RPM package:

    # dnf install ruby
    

     

    Once installed, you can confirm your system environment is FIPS-enabled by performing the following two checks in OpenSSL and Ruby.

    1. Verify the loaded OpenSSL providers

    Using the openssl command is an easy way to check this. Verify that OpenSSL is loading the fips provider along with the base and/or default providers. Run the openssl list -providers command to see the active providers:

    $ openssl list -providers
    Providers:
     base
       name: OpenSSL Base Provider
       version: 3.2.2
       status: active
     default
       name: OpenSSL Default Provider
       version: 3.2.2
       status: active
     fips
       name: Red Hat Enterprise Linux 9 - OpenSSL FIPS Provider
       version: 3.0.7-395c1a240fbfffd8
       status: active

     

    You can also double-check this in Ruby, using the OpenSSL::Provider class (introduced in Ruby OpenSSL versions 3.2.0) to list the provider names. This tip is helpful if you want to create a Ruby application for FIPS checks or audit purposes. You can check the installed Ruby OpenSSL version by running the following command:

    $ gem list openssl
    *** LOCAL GEMS ***
    openssl (default: 3.2.0)

     

    Then you can check a list of the providers by running the following command:

    $ ruby -ropenssl -e 'puts OpenSSL::Provider.provider_names'
    default
    fips
    base

     

    2. Check the fips=yes property of OpenSSL

    The fips=yes property queries for FIPS-approved cryptographic implementations. OpenSSL in RHEL 10 and 9 provides the C-API EVP_default_properties_is_fips_enabled, which was added in the upstream OpenSSL 3.2. Additionally, OpenSSL in RHEL 10, 9, and 8 includes the RHEL-specific C-API FIPS_mode. Unfortunately, the OpenSSL CLI openssl command doesn't provide a way to check the property. However, you can check the FIPS status with Ruby's OpenSSL.fips_mode method, which is equivalent to these APIs.

    $ ruby -ropenssl -e 'puts OpenSSL.fips_mode'
    true

     

    Handling prohibited cryptography algorithms in your Ruby application in FIPS mode

    If your Ruby application encounters an FIPS mode-specific error, it's likely trying to use a cryptographic algorithm that is not allowed. For instance, FIPS mode does not permit RSA 1024-bit keys, but it does allow RSA 2048-bit keys (per FIPS-186-5, section 5.1).

    The following example demonstrates how an application fails when using a prohibited RSA 1024-bit key size:

    $ ruby -ropenssl -e 'OpenSSL::PKey::RSA.generate(1024); puts "OK"'
    /usr/share/ruby/openssl/pkey.rb:344:in `generate_key': EVP_PKEY_keygen: invalid modulus (OpenSSL::PKey::PKeyError)
     from /usr/share/ruby/openssl/pkey.rb:344:in `generate'
     from -e:1:in `<main>'

     

    You can fix this error by using an approved RSA 2048-bit key size:

    $ ruby -ropenssl -e 'OpenSSL::PKey::RSA.generate(2048); puts "OK"'
    OK

     

    Forcing FIPS mode for testing

    For testing purposes, Red Hat added the OPENSSL_FORCE_FIPS_MODE environment variable to RHEL's downstream OpenSSL RPM. This variable lets you enable the OpenSSL FIPS module in a non-FIPS environment.

    $ export OPENSSL_FORCE_FIPS_MODE=1

     

    If you are already in RHEL FIPS mode, this variable is not necessary.

    Wrapping up

    You are now equipped with the basic knowledge to run your Ruby applications in FIPS mode on Red Hat Enterprise Linux. A key takeaway is that you can now run a recommended RHEL and Ruby version combination and verify your system environment. Most importantly, be vigilant about using FIPS-approved cryptographic algorithms and proactively testing for possible errors, like the prohibited use of RSA 1024-bit keys.

    My ongoing contributions to the upstream Ruby OpenSSL project, along with other project members and contributors, are focusing on improving FIPS-specific tests in the CI. This is to ensure that Ruby remains a stable and security-focused choice for FIPS-compliant environments on RHEL.

    Last updated: December 1, 2025

    Related Posts

    • Handling FIPS mode in upstream projects for RHEL

    • The benefits of native FIPS support in Go 1.24

    • FIPS mode for Red Hat Go Toolset

    • How to improve Go FIPS test coverage with Packit

    • Is your Go application FIPS compliant?

    • How I developed a faster Ruby interpreter

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    What’s up next?

    Custom-harden your new builds and keep them that way with Red Hat Lightspeed image builder and Red Hat Lightspeed compliance.

    Start learning
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.