Habr•August 12, 2026•🇷🇺Translated from Russian

AS2 in .NET Without Separate Java Gateway: Native EDI Exchange Directly in Application Routes

redb.Route.AS2 brings native AS2 protocol support to .NET applications, removing the requirement for separate commercial gateways or standalone Java servers. Organizations exchanging EDI documents with major retailers, 3PL operators, banks, or healthcare providers can now process signed and encrypted S/MIME messages directly inside their existing .NET integration routes.

Previously, .NET teams faced two main options: expensive commercial AS2 gateways such as Cleo, Seeburger, or BizTalk that required separate infrastructure, or open-source Java solutions like OpenAS2 and Mendelson Community that ran as additional JVM processes with inbox directories. Both approaches kept AS2 handling outside the main application logic.

AS2 (Applicability Statement 2, RFC 4130) ensures guaranteed delivery of business documents over the internet. A payload, typically X12 or EDIFACT but also XML or JSON, is optionally compressed, signed with the sender’s private key, and encrypted with the recipient’s public certificate. The resulting S/MIME envelope travels via HTTP POST, and the receiver returns a signed MDN (Message Disposition Notification) containing a cryptographic MIC hash for non-repudiation.

The library adds as2 and as2s endpoint schemes to redb.Route. Routes are defined using simple URI strings such as as2s://partner.example.com/as2?connectionFactory=walmart for outbound and as2:/inbound/orders?host=0.0.0.0&port=4080&connectionFactory=walmart for inbound traffic. Partner configurations are stored once in an As2ConnectionFactory object that holds certificates, AS2 identifiers, signing and encryption algorithms, and MDN mode settings.

Configuration supports environment-specific values through placeholders, allowing the same compiled route to run in development, staging, and production by changing only appsettings files. Secrets such as PFX passwords are supplied via environment variables or user secrets.

Outbound routes automatically compress, sign, encrypt, and transmit documents while parsing the returned MDN. Headers such as redbAs2.mdnDisposition, redbAs2.signatureValid, and redbAs2.mdnMicMatch are placed on the exchange for conditional routing logic. Inbound routes decrypt incoming messages, verify signatures, and deliver clean business documents to the pipeline along with exchange metadata.

Asynchronous MDN handling is supported through a dedicated receive endpoint that correlates receipts by Original-Message-ID. The cryptographic layer relies on MimeKit built on Bouncy Castle, ensuring interoperability with existing AS2 implementations.

Compared with external gateways, the native connector keeps documents flowing inside a single process, enables unified observability through distributed tracing, and allows full use of enterprise integration patterns without intermediate file drops or additional monitoring systems.

Related articles

Habr•Other

AmneziaWG Container for MikroTik Routers Delivers Top Performance Six Months After Launch

A developer released an AmneziaWG container for MikroTik devices in February 2026 and has since added major improvements in speed, protocol support, and stability. The lightweight container leverages the router's native WireGuard implementation for cryptography while handling AmneziaWG obfuscation in software. Performance now reaches 250-350 Mbit/s on models such as Hap Ax3 and RB5009B after switching to C code and increasing buffer sizes with RouterOS 7.24. New features include server mode for connecting multiple MikroTik devices, random port hopping, IPv6 support, dynamic DNS, and offline configuration. The project survived an early GitHub ban caused by test scripts and has grown to over 370 stars while remaining fully offline and privacy-focused.

Habr•Other

Building Resilient DoH Failover on MikroTik RouterOS to Handle Unreachable Cloudflare Responses

A network administrator encountered a persistent issue in a branch office where pages like Tailwind CSS CDN failed to load despite valid DNS responses from Cloudflare DoH. The problem stemmed from unreachable IP addresses such as 8.6.112.0 and 8.47.69.0 returned by the resolver, which RouterOS treated as healthy because it only checked for valid IP types rather than route reachability. RouterOS supports only a single active DoH upstream via the use-doh-server parameter, requiring custom scripting for failover between multiple endpoints like Cloudflare and dns.google. The solution involved static DNS entries for bootstrap addresses, certificate trust anchors including SSL.com TLS ECC Root CA 2022, and a health monitor script that probes using DNS-JSON API calls instead of switching the resolver directly. Multiple iterations addressed issues like cache-based false positives, plain DNS fallback risks from provider spoofing, and clock validation to prevent certificate failures. The final implementation uses thresholds for failure and recovery to avoid flapping and ensures post-switch verification before committing to a backup endpoint.

Habr•Other

NetRuleRouter Alpha Released to Route Traffic Across Multiple Connections Without Disabling VPN

Developer krox1 has released the first public alpha of NetRuleRouter v0.1.0-alpha.1 for Windows and Linux, a local network policy manager that distributes traffic between primary and secondary connections based on domains, IP ranges, applications, and subnets. The tool emerged from practical issues that intensified after Russian authorities discussed VPN restrictions in March 2026, with operators and platforms later prompting users to disable VPN for domestic services. NetRuleRouter sits on top of existing connections rather than acting as a VPN client or proxy, allowing users to keep corporate VPNs, personal VPNs, and direct internet active simultaneously. It supports seven matching methods including exact domains, wildcard subdomains, CIDR ranges, and application paths, with priority rules to resolve overlaps and built-in leak protection that prevents protected destinations from falling back when the secondary connection drops. The alpha includes diagnostic tracing, preset rule sets for Russia and other regions, import/export capabilities, and a first-run wizard that configures the background service and initial bindings. Limitations around DNS, shared IPs, and brief startup windows are documented, and the project explicitly does not protect against account-level blocks by services such as Anthropic.

Habr•Other

Setting Up Nextcloud Talk on TrueNAS with Custom Domain for Private Family Calls

A detailed guide explains how to deploy Nextcloud Talk on a TrueNAS server behind a custom domain to create a self-hosted messaging and calling platform for family use. The author addresses problems with commercial messengers such as VK notifications failing on iOS and Telegram requiring VPN connections. The solution uses HestiaCP on a VPS for reverse proxying, Let's Encrypt SSL certificates, and port forwarding on a home router to reach the TrueNAS instance at 192.168.0.17:30027. Additional steps cover configuring coturn for TURN relay to enable reliable voice and video calls, updating trusted domains in Nextcloud, and disabling router DoS protection. The setup also enables Screen Sharing, reactions, and push notifications while keeping all data under user control.