How to Ignore an Invalid SSL Certificate in Java
Sometimes during development it is useful to use a certificate whose CN (Common Name) does not match the host name in the URL, for exampleRead more…
localhost. In these cases Java will throw an
SSLHandshakeException. How can we easily disable certificate checking for
localhostand other domains of our choosing?
Creating Custom Intershop ISML Functions With CustomTag
In this post, I’ll look at leveraging Intershop’sRead more…
CustomTagto create custom functionality in ISML templates.
Java Stateful Sessions or How to Properly Send Cookies With Each Redirect Request
Sometimes you need to log in to some webpage programmatically. I ran into one of those pages where, when the login succeeds, you’re being redirected to another page, and then to another (something along the lines of ‘Please login’ -> ‘You are successfully logged in’ -> ‘Admin panel’). So I needed to write something that would store the cookies that come along with each response, and send those cookies out with each subsequent request. With
curl, I would have used:
$ curl --location --cookie-jar logincookie 'https://login.securepage.com'
So how can we emulate this behavior in Java?Read more…
Adding a File to the Root of Your Gradle Distribution
A while ago, I needed to write a program that retrieved some information from the database by using SQL queries located in files. I wanted to add a file that would contain the settings of the app, like the port, SID, login and password for the database, but also the location of those queries. The problem was I couldn’t add those settings to a file in the standardRead more…
src/groovy/resourcesfolder, because when creating a distribution with Gradle
./gradlew distZipthe file would be part of the jar, and thus it would be difficult to modify the contents. I was basically after a run-control file, a settings file in the root of my distribution, that I could easily change on each run (if necessary).