Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup mTLS proxy server #776

Open
ddLesha opened this issue Oct 2, 2024 · 6 comments
Open

setup mTLS proxy server #776

ddLesha opened this issue Oct 2, 2024 · 6 comments

Comments

@ddLesha
Copy link

ddLesha commented Oct 2, 2024

We have a mTLS proxy server in DMZ, and client applications with auth certificate can send requests to private network through it. Currently I using iOS 17.0+ api:
ProxyConfiguration.init(
httpCONNECTProxy: NWEndpoint,
tlsOptions: NWProtocolTLS.Options? = nil
)

sec_protocol_challenge_t is called then proxy asks auth certificate and all proccess is working.

How to setup TLSConfiguration for certificate auth with mTLS proxy ?

@Lukasa
Copy link
Collaborator

Lukasa commented Oct 2, 2024

Do you need a callback to work out which cert to set, or are you setting the cert unconditionally?

@ddLesha
Copy link
Author

ddLesha commented Oct 2, 2024

Yes, I need to set user auth certificate unconditionally. This cert will be shown to mTLS proxy with every request through proxy.

@Lukasa
Copy link
Collaborator

Lukasa commented Oct 2, 2024

Place the identity cert and any intermediate certs at TLSConfiguration.certificateChain and the private key at TLSConfiguration.privateKey.

@ddLesha
Copy link
Author

ddLesha commented Oct 2, 2024

Sorry, I forget to mention - all clients is iOS devices (iPhones, iPads).
If I setup certificateChain - the error appears:

Fatal error: TLSConfiguration.certificateChain is not supported. You can still use this configuration option on macOS if you initialize HTTPClient with a MultiThreadedEventLoopGroup. Please note that using MultiThreadedEventLoopGroup will make AsyncHTTPClient use NIO on BSD Sockets and not Network.framework (which is the preferred platform networking stack).

@Lukasa
Copy link
Collaborator

Lukasa commented Oct 2, 2024

Ah yes, this is a current limitation of async-http-client. You'll need to follow the instructions in that message, to use MultiThreadedEventLoopGroup instead of the platform specific EL. Right now there isn't an easy way for us to create a SecIdentity which is what you need, so we'd need to offer an entirely new API that allows you to provide it.

@ddLesha
Copy link
Author

ddLesha commented Oct 2, 2024

Ah yes, this is a current limitation of async-http-client. You'll need to follow the instructions in that message, to use MultiThreadedEventLoopGroup instead of the platform specific EL. Right now there isn't an easy way for us to create a SecIdentity which is what you need, so we'd need to offer an entirely new API that allows you to provide it.

Thanks for giving right direction, I will try to use MultiThreadedEventLoopGroup today and post result here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Lukasa @ddLesha and others