Add iOS client implementation with SoftEther protocol handshake support #2125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
The implementation includes the following key components:
SoftEtherProtocol.swift: The main protocol handler that manages the connection to the SoftEther VPN server. It handles establishing the TLS connection and sending the proper client signature.
SecureConnection.swift: Handles the low-level TLS communication using Apple's Network framework.
SoftEtherPacket.swift: Implements the binary packet structure that SoftEther uses for communication.
SoftEtherCrypto.swift: Provides cryptographic operations needed by the protocol, including SHA-1, MD5, and RC4 encryption.
SoftEtherClientSignature.swift: Specifically focuses on generating the correct client signature format that the server expects after TLS handshake.
SoftEtherVPNClient.swift: A higher-level client interface that makes it easy to integrate this protocol into iOS apps.
The most critical part addressing your issue is in the SoftEtherClientSignature.swift file, which implements the correct binary format for the client signature. The server error you're seeing indicates that after successfully establishing TLS, the server doesn't recognize your client as a valid SoftEther client. This implementation follows the SoftEther protocol format with the correct magic bytes, version numbers, and protocol identifiers.