Skip to content

How to add custom trust manager? #472

@imanushin

Description

@imanushin

I'm trying to add a custom trust manager to have an ability of API usage in a case when different trust managers are required to connect to different services from the same process. I don't want just adding an option "ignoreTls", because that will be too insecure.

As far as I understand, all settings must be json serializable. Of course interface X509TrustManager can't be serialized.

In fact, to put a custom X509TrustManager, I have to put a custom SSLSocketFactory (this is okhttp limitation - please check method sslSocketFactory), so these settings must go in pairs.

What would be the best option to add these settings? I can exclude them from json serialization (so, they could be added only manually) for example, or probable they could be added as a separate runtime parameter (however - how? do we have this option at all?).

Alternatively, the trust manager can be built on-the-fly if we request trusting certificates (in base64) and build our own one, however that might be close to reinventing the wheel.

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions