Create a PFX certificate file using OpenSSL

I usually work with Linux-based operating systems for web development. However, my company does run a couple of Microsoft Windows(R) servers for internal financial systems. When securing connections to Windows services, it is often useful to have certificates available in PFX format.

To convert a private key, certificate, and (optionally) any trusted chains; you will need the following:

  • The private key file.
  • A PEM containing the corresponding certificate.
  • Additional trust chains to be included (may also be included in the PEM in bullet 2).
  • OpenSSL (I tested this with the Mac OS X High Sierra – LibreSSL 2.2.7).

Place all of the files in your home directory and start a terminal session. Execute the following command, replacing the file names where appropriate for the files you have prepared:

openssl pkcs12 -export -out trevweb.pfx -inkey trevweb.key -in trevweb.crt -certfile trust-chain.crt

Assuming everything executed correctly, you should now have a ‘trevweb.pfx’ file located in your home directory ready to be imported easily by Windows services. A PFX, or I think more accurately a PKCS #12, file is a binary file format that may contain multiple certificate bundles.

SMTP Service Auto-Start on Windows Server 2016

I recently installed the SMTP (Simple Mail Transfer Protocol) feature to Windows Server 2016. Everything seemed fine until I discovered that the SMTP service does not start automatically on system re-boot. Furthermore, the service is not listed under the Services management snap-in. Operating the SMTP service via the IIS Manager 6.0 manager manually works just fine.

This situation can be remedied at the command prompt using ‘sc’. i.e.

sc config smtpsvc start= auto

Note that there is a space between the parameter ‘start=’ and the value ‘auto’. This is intentional and all name/value pairs need to be separated like this.

All being well, a confirmation will be displayed:

[SC] ChangeServiceConfig SUCCESS

This does not solve the problem of the SMTP not being listed under the services management snap-in. If anyone can shed any light on that, please leave a comment.

I do know that the display name for the service is ‘Simple Mail Transfer Protocol (SMTP)’. This can be confirmed by executing:

sc getdisplayname smtpsvc

Deskspace Project

I was recently reminded of Deskspace Project this month at Staffs Web Meet-up. I love this idea and think it is worth spreading; hence this blog post.

Deskspace Project is a free-of-charge hot desk facility for new entrepreneurs. This is a great opportunity for those looking to start a new business and want a base of operations in the fledgling months; providing a modern office environment with tea, coffee and wireless Internet access.

TopCashback provides this facility and, amongst other things, sponsors the excellent Staffs Web Meet-up (which I try not to miss).

SSLing All of My Things

I have been thinking about activating HTTPS/SSL on all my web things for a while now. I was procrastinating for two reasons; avoiding expenditure and not wanting to mess about with configurations.

Enter Let’s Encrypt and the emergence of widely available and free SSL/TLS certificates. I tend to use Apache on Ubuntu/Debian and often use Plesk for managing some small virtual private servers. Let’s Encrypt provides easy and simple means for a person like me to automatically install SSL certificates; there’s even a Plesk plugin.

My ISP, OVH, has even taken the trouble to support Let’s Encrypt as a sponsor and enable SSL hosting, free of charge, with all of their hosting packages. I think this is a great move.

So, with my reasons for procrastinating gone, it’s about time I get to work! I’ve started with this blog and I hope you’re viewing this post securely!

Merry Christmas 2016!

It has been a while since I last posted. I’m sure you’ll all be glad to know that I’m still alive and bothering people.

In the Brexit spirit, I wanted to tell everyone that Christmas means Christmas! I’m committed to making it work for everyone. I’ll let you know my Christmas plans by late March; they might be coloured.

Seriously though, I’ll be out of my hole again soon. The three or four of you that have missed my posts were very kind to let me know!

Code Club at Bentilee Library

I’m co-running a new Code Club at Bentilee Library with Samuel Freeman. It is the first Code Club to run in a Stoke-on-Trent library. It has run for three weeks and it has been excellent. The kids have been learning to program games using Scratch. The Sentinel stopped by last week to see what was going on and wrote a great article.

Samuel Freeman setting up the Library systems for Code Club
Samuel Freeman setting up Bentilee Library systems for Code Club.

Enable Three Finger Drag in OS X 10.11 El Capitan

The gesture support in Mac OS X has been superb for many years. I recently had cause to set-up a new Mac and was confounded by the lack of three-finger drag support in the Track Pad settings. Three-finger drag on a track pad is my preferred setting.

I eventually found the setting, tucked away in Accessibility under System Preferences. Upon activating Accessibility, scroll to the ‘Interacting’ group from the list on the left. Select ‘Mouse & Trackpad’, click ‘Trackpad Options…’ and check ‘Enable dragging’. Lastly, select ‘three finger drag’ from the list.

Enable Three Finger Drag under Accessibility
Settings/Accessibility houses the Mouse & Trackpad preferences pane.

I can never figure out why these things have to change, but they do.

Meetup – Functional Programming with Clojure

Agile Staffordshire will be hosting an event on Thursday, 29th October at 19:00. Paul Williams will be introducing Clojure.

The event represents a splendid opportunity to get to grips with functional programming, often mistakenly assumed to be a niche, academic language with little practical application. Paul Williams is an adept software developer and always delivers an interesting and informative session.

Further detail regarding the meet-up can be found on the Agile Staffordshire event page. If you are reading this and want to sign up to attend, it can all be achieved from the Meetup event listing. The session is free and the venue is kindly provided by Staffordshire University‘s Faculty of Computing, Engineering and Sciences. I hope to see you there!