How to automate create Function App with Blob Trigger and Sendgrid Notification through Azure Arm Template and deploy
In previous post (Trigger Email on Blob Trigger), we saw how we can create such…
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.
In previous post (Trigger Email on Blob Trigger), we saw how we can create such…
Introduction In this guide, we will see git basic commands, and fundamentals of…
Problem Statement I’ve been using image styles, and heavily used “Scale and crop…
Introduction Cyberark kind of tools are a must for security in your…
One of the biggest task while writing article or blog is to have right set of…
Introduction In our previous post, where we saw How to configure comments module…
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…