Hi, author here. I needed to support RSA .pem keys to support SSH access to older Amazon EC2 instances, but swift-nio-ssh deliberately doesn't support them, so I had to roll my own and ran into a few gotchas worth noting and sharing. Long story short: There's a fork (complete with the latest security advisories) available of swift-no-ssh with said RSA support now and the blog post describes the changes. Happy to answer any questions!
Adding RSA Support to swift-nio-ssh
Why swift-nio-ssh cannot use an Amazon EC2 .pem key, what it took to fix, and the trap waiting for anyone who tries it themselves.

Key takeaways
The swift-nio-ssh library lacks RSA support, which is needed for older Amazon EC2 key pairs. Adding RSA required modifying the module and external dependencies.
- swift-nio-ssh does not support RSA, preferring modern algorithms like ed25519.
- Amazon EC2 uses RSA keys, making RSA support necessary for compatibility.
- Adding RSA required changes to the module and external dependencies like swift-crypto.
Summarised automatically by AI from the original article by Hacker News. AI can make mistakes, so check the original for details.
Story details
- Published
- By
- moonlighter
- Format
- Article
- Original
- lograker.app ↗




