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

Support external SSLContext #30

Closed
fdulger opened this issue Jan 15, 2019 · 2 comments
Closed

Support external SSLContext #30

fdulger opened this issue Jan 15, 2019 · 2 comments

Comments

@fdulger
Copy link

fdulger commented Jan 15, 2019

In our particular case, we need to use SSL but bypass the certificate check. When TcpSyslogMessageSender is set to use SSL it creates a secure socket using default SSLSocketFactory. It could be better if I can provide a custom SSLContext and that is used to open the socket.

In TcpSyslogMessageSender:

ensureSyslogServerConnection(){
...
    if(sslContext == null) {
        socket = SSLSocketFactory.getDefault().createSocket();
    } else {
        socket = sslContext.getSocketFactory().createSocket();
    }
...
}

...

public synchronized void setSSLContext(SSLContext sslContext) {
    this.sslContext = sslContext; 
}    
public synchronized SSLContext getSSLContext() {
    return this.sslContext; 
}
@KevUKHD
Copy link

KevUKHD commented Feb 13, 2020

I'll second that.
This would be very useful to have.
For my usecase, I need to add my own Keystore / Certificate to the sslContext.

@fdulger
Copy link
Author

fdulger commented Feb 21, 2020

@KevUKHD This is available since 1.1.7

@fdulger fdulger closed this as completed Feb 21, 2020
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

2 participants