MindscapeHQ/raygun4android

Allow SSLContext to be provided

DanFTRX opened this issue · 2 comments

Raygun uses OkHttpClient to make it's posts.

Use Case:

  • We have overridden the endpoint to a different endpoint
  • The certificates involved are not be trusted by the phones default CA's (internal network)

Problem:
The default SSLContext will fail to handshake and the requests will fail.

Solution:
Allow a SSLContext to be supplied to RaygunSettings that will be set on the OKHttpClient:

    new OkHttpClient.Builder()
     .sslSocketFactory(sslContext.getSocketFactory())

This would be needed in both post services
https://github.com/MindscapeHQ/raygun4android/blob/master/provider/src/main/java/com/raygun/raygun4android/services/CrashReportingPostService.java#L114
https://github.com/MindscapeHQ/raygun4android/blob/master/provider/src/main/java/com/raygun/raygun4android/services/RUMPostService.java#L69

Todo: look into not using OKHttp and remove the dependency completely in favour some some URLConnection class.