How to Fix Drupal Mysql error - Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes
Introduction While this topic may applicable to all mysql/mariadb users who…
June 03, 2018
The problem comes while using FTPS. When developer uses login method of this library while authentication, it prints username and password in console, which is a huge security concern. Also, it exposes user credentials to logs. And, anyone can read those credentials if he or she has access to those logs.
FTPClient ftpClient = null;
FTPSClient ftps = new FTPSClient("TLS", false);
//accept all for now
ftps.setTrustManager(TrustManagerUtils.getAcceptAllTrustManager());
//verbose
ftps.addProtocolCommandListener(
new PrintCommandListener( new PrintWriter(new OutputStreamWriter(System.out, "UTF-8"), true)));
ftpClient = ftps;
//set connect timeout
ftpClient.setConnectTimeout(config.getConnectTimeout());
ftpClient.connect(host);
ftps.execPROT("P");
//SSL mode
if(ftpClient.login(username, password)) {
//successfully login
}
else {
//error condition
}
FTPClient ftpClient = null;
FTPSClient ftps = new FTPSClient("TLS", false);
//accept all for now
ftps.setTrustManager(TrustManagerUtils.getAcceptAllTrustManager());
//verbose
ftps.addProtocolCommandListener(new ProtocolCommandListener() {
@Override public void protocolReplyReceived(ProtocolCommandEvent arg0) { }
@Override public void protocolCommandSent(ProtocolCommandEvent arg0) { }
});
ftpClient = ftps;
//set connect timeout
ftpClient.setConnectTimeout(config.getConnectTimeout());
ftpClient.connect(host);
ftps.execPROT("P");
//SSL mode
if(ftpClient.login(username, password)) {
//successfully login
}
else {
//error condition
}
Note: Above code is just to show the problem of showing passwords in concole. I will write a complete better implementation of ftp and ftps apis.
Introduction While this topic may applicable to all mysql/mariadb users who…
Introduction to Problem I have some data related to users. For example: which…
Problem In drupal textarea field, it was always a pain to see the two links…
ReactJS setState is Asynchronous setState() method in ReactJS class components…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In the ReactJS project, you are having aa parent component and a…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…