Troubleshoot AWS Lambda unknown error!
After 2 days, there was my demo. I deployed my nodejs code on lambda function…
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.
After 2 days, there was my demo. I deployed my nodejs code on lambda function…
I was using On page optimization of the article pages, and found that meta…
I use drupal-7 in my website. I used to write articles and put images in that…
This will take backup of your passed database name, to the passed folder. It…
hook_cron() suggests to put tasks that executes in shorter time or non-resource…
Introduction If you working on a github project in a team. Consider you have…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…
Introduction We often require to execute in timed manner, i.e. to specify a max…
Introduction In some of the cases, we need to specify namespace name along with…
Introduction In most of cases, you are not pulling images from docker hub public…