Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:33:37+00:00 2026-06-05T22:33:37+00:00

I am writing an SMTP server in Ruby, and I am trying to figure

  • 0

I am writing an SMTP server in Ruby, and I am trying to figure out what the correct way to handle the SSL/TLS error “decryption failed or bad record mac” is

Retrying the operation spits out random garbage from #read_nonblock, and apart from being rude and closing the connection, I’m not sure what to do

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:33:39+00:00Added an answer on June 5, 2026 at 10:33 pm

    Yourself being the server here, the message would indicate that either OpenSSL wasn’t able to properly decrypt the TLS records sent by the client or that the MAC computation failed, i.e. the client’s tag doesn’t match the one you computed.

    Apart from bugs or network errors (as EJP mentioned), this can also happen if someone actively changed the content sent, the wrong message was sent or only a partial message was sent etc. etc.

    In any case, as the server, you don’t want to try to rescue such a connection. After all, it could be an attack. The proper way to handle this event is to call SSLSocket#close which will try to execute a SSL_shutdown which again will attempt to send the “close notify” alert to the client, which is the graceful TLS way of telling the peer that you’re about to close this connection.

    In order to resume communication with a client where this happened, you would negotiate a new connection started from scratch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a simple SMTP server and client. Server is in two parts
I am trying to use gmail's SMTP server smtp.gmail.com to send mails using C
I can't figure out why this isn't working. I'm trying to send an email
I'm interested in writing a SMTP mail server that just sends emails? I would
I am writing an SMTP parser that needs to handle standard smtp as well
Writing a python program, and I came up with this error while using the
Writing a client application that sends images to a server via a webservice. As
I'm writing a regular expression that can interactively validate SMTP responses codes, once the
I'm writing some new code that involves POP3 manipulation. I'm trying to come up
My application is receiving email through SMTP server. There are one or more attachments

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.