René's URL Explorer Experiment


Title: TLS PSK intermittently fails with `TlsFatalAlertReceived: bad_record_mac(20)` · Issue #1876 · bcgit/bc-java · GitHub

Open Graph Title: TLS PSK intermittently fails with `TlsFatalAlertReceived: bad_record_mac(20)` · Issue #1876 · bcgit/bc-java

X Title: TLS PSK intermittently fails with `TlsFatalAlertReceived: bad_record_mac(20)` · Issue #1876 · bcgit/bc-java

Description: I think I am experiencing a possible race condition in either TlsClientProtocol or TlsServerProtocol. I am using bctls-jdk18on 1.78.1. I can reproduce an intermittent failure in a JUnit test. It performs: 10 repeats of a client/server ec...

Open Graph Description: I think I am experiencing a possible race condition in either TlsClientProtocol or TlsServerProtocol. I am using bctls-jdk18on 1.78.1. I can reproduce an intermittent failure in a JUnit test. It pe...

X Description: I think I am experiencing a possible race condition in either TlsClientProtocol or TlsServerProtocol. I am using bctls-jdk18on 1.78.1. I can reproduce an intermittent failure in a JUnit test. It pe...

Opengraph URL: https://github.com/bcgit/bc-java/issues/1876

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TLS PSK intermittently fails with `TlsFatalAlertReceived: bad_record_mac(20)`","articleBody":"I think I am experiencing a possible race condition in either TlsClientProtocol or TlsServerProtocol. \r\n\r\nI am using bctls-jdk18on 1.78.1.\r\n\r\nI can reproduce an intermittent failure in a JUnit test. It performs:\r\n- 10 repeats of a client/server echo test, using plaintext communication\r\n- 10 repeats of a client/server echo test, using TLS PSK communication\r\n\r\nSometimes all 20 tests pass. Other times only 19 out of 20 tests pass.\r\n1. Plaintext tests 1 through 10 always pass.\r\n2. TLS PSK test 1 intermittently passes, or fails with exception TlsFatalAlertReceived: bad_record_mac(20).\r\n3. TLS PSK tests 2 through 10 always pass.\r\n\r\nI uploaded a Maven project to GitHub to demonstrate the issue.\r\n- https://github.com/justincranford/bc-tls-psk\r\n\r\nHere are screenshots comparing when all tests passed, versus when all tests passed except the first TLS PSK test.\r\n\r\n![image](https://github.com/user-attachments/assets/813b0665-2b37-4d87-b643-b9a009035398)\r\n![image](https://github.com/user-attachments/assets/3a6ca94b-fa85-4875-ae30-4bd9d3f97b01)\r\n\r\nIf TLS PSK test #1 fails, the stack trace is:\r\n```\r\ncom.github.justincranford.psk.PskTlsTest\r\ntestTlsPsk(com.github.justincranford.psk.PskTlsTest)\r\norg.bouncycastle.tls.TlsFatalAlertReceived: bad_record_mac(20)\r\n\tat org.bouncycastle.tls.TlsProtocol.handleAlertMessage(TlsProtocol.java:245)\r\n\tat org.bouncycastle.tls.TlsProtocol.processAlertQueue(TlsProtocol.java:740)\r\n\tat org.bouncycastle.tls.TlsProtocol.processRecord(TlsProtocol.java:563)\r\n\tat org.bouncycastle.tls.RecordStream.readRecord(RecordStream.java:247)\r\n\tat org.bouncycastle.tls.TlsProtocol.safeReadRecord(TlsProtocol.java:879)\r\n\tat org.bouncycastle.tls.TlsProtocol.blockForHandshake(TlsProtocol.java:427)\r\n\tat org.bouncycastle.tls.TlsClientProtocol.connect(TlsClientProtocol.java:88)\r\n\tat com.github.justincranford.psk.PskTlsTest$PskTlsClient.send(PskTlsTest.java:79)\r\n\tat com.github.justincranford.psk.PskTlsTest.doClientServer(PskTlsTest.java:62)\r\n\tat com.github.justincranford.psk.PskTlsTest.testTlsPsk(PskTlsTest.java:51)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)\r\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\r\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\r\n\tat java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)\r\n\tat java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)\r\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\r\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\r\n\tat java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)\r\n\tat java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)\r\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\r\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\r\n\tat java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)\r\n\tat java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)\r\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)\r\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\r\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1596)\r\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1596)\r\n```\r\n","author":{"url":"https://github.com/justincranford","@type":"Person","name":"justincranford"},"datePublished":"2024-10-23T03:39:42Z","url":"https://github.com/bcgit/bc-java/issues/1876"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e1c2c0d9-72bd-77e3-7bf0-753082998740
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA5C:2E1019:DC0FF2:12FD527:6AFBF066
html-safe-nonce87d09bf6acf34ef17a0e86394d7574e0e1cffca19946718ae944cd807ea790ca
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTVDOjJFMTAxOTpEQzBGRjI6MTJGRDUyNzo2QUZCRjA2NiIsInZpc2l0b3JfaWQiOiI0MTcxMjEyMjY5MDQxNzQxOTI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3b456114a90bcd3ea812ce12aaed1820a3d123dc3191053710ac0cfab7c12bee
hovercard-subject-tagissue:2607094211
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bcgit/bc-java/1876/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d0b0031e75097bd5c4f67e6220bbe88b794016fc14958c88f2189d33c3c35df9/bcgit/bc-java/issues/1876
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d0b0031e75097bd5c4f67e6220bbe88b794016fc14958c88f2189d33c3c35df9/bcgit/bc-java/issues/1876
og:image:altI think I am experiencing a possible race condition in either TlsClientProtocol or TlsServerProtocol. I am using bctls-jdk18on 1.78.1. I can reproduce an intermittent failure in a JUnit test. It pe...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejustincranford
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
go-importgithub.com/bcgit/bc-java git https://github.com/bcgit/bc-java.git
octolytics-dimension-user_id4566970
octolytics-dimension-user_loginbcgit
octolytics-dimension-repository_id10416648
octolytics-dimension-repository_nwobcgit/bc-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id10416648
octolytics-dimension-repository_network_root_nwobcgit/bc-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/bcgit/bc-java/issues/1876#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F1876
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F1876
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=bcgit%2Fbc-java
Reloadhttps://github.com/bcgit/bc-java/issues/1876
Reloadhttps://github.com/bcgit/bc-java/issues/1876
Reloadhttps://github.com/bcgit/bc-java/issues/1876
bcgithttps://github.com/bcgit
bc-javahttps://github.com/bcgit/bc-java
Codehttps://github.com/bcgit/bc-java
Issues47 (47)https://github.com/bcgit/bc-java/issues
Pull requests18 (18)https://github.com/bcgit/bc-java/pulls
Discussionshttps://github.com/bcgit/bc-java/discussions
Actionshttps://github.com/bcgit/bc-java/actions
Projectshttps://github.com/bcgit/bc-java/projects
Wikihttps://github.com/bcgit/bc-java/wiki
Security and qualityhttps://github.com/bcgit/bc-java/security
Insightshttps://github.com/bcgit/bc-java/pulse
https://github.com/bcgit/bc-java
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1876
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1876
TLS PSK intermittently fails with TlsFatalAlertReceived: bad_record_mac(20)https://github.com/bcgit/bc-java/issues/1876#top
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
https://github.com/justincranford
justincranfordhttps://github.com/justincranford
on Oct 23, 2024https://github.com/bcgit/bc-java/issues/1876#issue-2607094211
https://github.com/justincranford/bc-tls-pskhttps://github.com/justincranford/bc-tls-psk
https://private-user-images.githubusercontent.com/2488888/379087728-813b0665-2b37-4d87-b643-b9a009035398.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ4OTYyNzQsIm5iZiI6MTc5NDg5NTk3NCwicGF0aCI6Ii8yNDg4ODg4LzM3OTA4NzcyOC04MTNiMDY2NS0yYjM3LTRkODctYjY0My1iOWEwMDkwMzUzOTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTExNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMTdUMDYxMjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjMzNzNmZDA4NTRjNDdlNjJhMWNlYzQxZWEzZjg0ZWY3YTQxOTIwNDVjNTcxMjllMDg4NGQyYTRjMmM3NTFmNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.A_zB_Pf-Uxqbh_SUOe9LvH31Y1lkKxz0wmmTCtpXT2w
https://private-user-images.githubusercontent.com/2488888/379088060-3a6ca94b-fa85-4875-ae30-4bd9d3f97b01.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ4OTYyNzQsIm5iZiI6MTc5NDg5NTk3NCwicGF0aCI6Ii8yNDg4ODg4LzM3OTA4ODA2MC0zYTZjYTk0Yi1mYTg1LTQ4NzUtYWUzMC00YmQ5ZDNmOTdiMDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTExNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMTdUMDYxMjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDM4MjI3MWE5ZDNmOTdkMjA1M2Y0MDJhMjk5Y2RmMmJjNDk3MDE2MzhhYjAxNjI1NjY2NWY2OGM1NDY1NWI3MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.wd5iU45ZDWU3BDT8HstUI2wW_PqHF7qvN6PzKiyIwqU
#1https://github.com/bcgit/bc-java/pull/1
https://github.com/justincranford
justincranfordhttps://github.com/justincranford
on Oct 23, 2024https://github.com/bcgit/bc-java/issues/1876#issuecomment-2430805275
https://github.com/justincranford
justincranfordhttps://github.com/justincranford
on Oct 27, 2024https://github.com/bcgit/bc-java/issues/1876#issuecomment-2440129387
https://github.com/peterdettman
peterdettmanhttps://github.com/peterdettman
on Oct 28, 2024https://github.com/bcgit/bc-java/issues/1876#issuecomment-2440647541
https://github.com/justincranford
justincranfordhttps://github.com/justincranford
on Oct 30, 2024https://github.com/bcgit/bc-java/issues/1876#issuecomment-2448575079
justincranfordhttps://github.com/justincranford
completedhttps://github.com/bcgit/bc-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 30, 2024https://github.com/bcgit/bc-java/issues/1876#event-15019553401
https://github.com/justincranford
justincranfordhttps://github.com/justincranford
on Oct 30, 2024https://github.com/bcgit/bc-java/issues/1876#issuecomment-2448578113
winfriedgerlachhttps://github.com/winfriedgerlach
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
on Dec 13, 2024https://github.com/bcgit/bc-java/issues/1876#event-15646904055
Sign up for freehttps://github.com/signup?return_to=https://github.com/bcgit/bc-java/issues/1876
Sign in to commenthttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1876
support requestCommunity assistance requestedhttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22support%20request%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.