Skip to content

[SCI-22111][NGX][NGL][NIR][Security] Switch to https for Profile Builder#19

Open
AnkitManeSciAps wants to merge 17 commits intomasterfrom
ankit/SCI-22111
Open

[SCI-22111][NGX][NGL][NIR][Security] Switch to https for Profile Builder#19
AnkitManeSciAps wants to merge 17 commits intomasterfrom
ankit/SCI-22111

Conversation

@AnkitManeSciAps
Copy link

No description provided.

Comment on lines +240 to +250
public static class SSLSafeHttpServerConnection extends DefaultHttpServerConnection {
@Override
public void close() throws IOException {
try {
// This attempts to call shutdownOutput(), which fails on Android SSL
super.close();
} catch (UnsupportedOperationException e) {
// Catch the specific Android error
// verify the socket exists and force-close it to prevent leaks
if (getSocket() != null) {
getSocket().close();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

https://square.github.io/okhttp/changelogs/changelog/#version-521

close() method attempts to call shutdownOutput() which fails and throw the exception and thus to avoid it I had to override the implementation and catch it in and close force-close the socket to prevent leaks

private boolean mIsDebugBuild;
private KeyManager[] mKeyManagers;
private TrustManager[] mTrustManagers;
private static final Logger LOGGER = LoggerFactory.getLogger(ServerBuilder.class.getSimpleName());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnkitManeSciAps - unused?

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

Successfully merging this pull request may close these issues.

3 participants