Frost on a roof

How acme4j handles POST-as-GET requests

In the latest ACME draft 15, Let's Encrypt introduced POST-as-GET requests. It is a breaking change that is not downward compatible to previous drafts.

This brought me into an uncomfortable position. While the Pebble server enforces the use of POST-as-GET, other servers don't support it yet, like the Let's Encrypt server. For this reason, acme4j needs to support both the pre-draft-15 GET requests and the post-draft-15 POST-as-GET requests. Luckily I have found a solution that is totally transparent to the user, at least as long as no other ACME server is used.

This is how acme4j v2.4 works:

  • If you connect to Boulder via an acme://letsencrypt.org URI, acme4j falls back to a compatibility mode that still sends GET requests. Let's Encrypt has announced a sunset date for GET requests on November 1st, 2019. You are safe to use acme4j v2.4 (and older versions) up to this date.
  • If you connect to a Pebble server via an acme://pebble URI, the new POST-as-GET requests are used.
  • If you connect to a different server implementation via http: or https: URI, acme4j sends POST-as-GET requests now. This is likely going to fail at runtime, if the server you connect to does not support draft-15 yet.
  • As a temporary workaround, you can add a postasget=false parameter to the server URI (e.g. https://localhost:14000/dir?postasget=false) to make acme4j enter the fallback mode and send GET requests again.

As soon as Let's Encrypt supports POST-as-GET on their production servers, I will remove the fallback mode from acme4j again. It just clutters the code, and I also have no proper way to test it after that.

Hint: Before updating acme4j, always have a look at the migration guide. It will show you where you can expect compatibility issues.

Google Earth Pro auf Fedora installieren

In dem Fedorablog, den ich ganz früher mal geschrieben hatte, hatte ich ein regelmäßig wiederkehrendes Thema: Die Installation von Google Earth. Lange Zeit war das echte Handarbeit, obwohl Google ein RPM-Paket bereitstellte.

Seitdem sind viele Jahre vergangen. Mittlerweile stellt Google die ehemals kostenpflichtige Pro-Version von Google Earth zum kostenlosen Download für Linux zur Verfügung. Und auch die Installation ist glücklicherweise kein Problem mehr. Es reicht schon, das RPM-Paket zu installieren:

sudo dnf install google-earth-pro-stable-current.x86_64.rpm

Auf deutschen und österreichischen Systemen¹ muss anschließend noch eine kleine manuelle Änderung vorgenommen werden. Der Grund dafür ist, dass die Google-Server bei der Ortssuche Geokoordinaten mit Dezimalpunkt ausliefern, das System aber das bei uns übliche Dezimalkomma erwartet und die Zahlen deshalb nicht verarbeiten kann. Die virtuelle Erdkugel dreht sich dann immer mitten auf den Atlantik statt auf die gewünschte Markierung.

Eine einfache Lösung ist, die Datei /opt/google/earth/pro/googleearth mit einem Texteditor zu bearbeiten (Root-Rechte erforderlich) und in der letzten Zeile der Datei ein LC_NUMERIC=us_US.UTF-8 einzufügen:

LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH LC_NUMERIC=us_US.UTF-8 ./googleearth-bin "$@"

Danach sollte Google Earth Pro problemlos und stabil laufen.


¹) Nach meinen Recherchen verwendet ein Linux mit schweizerdeutscher Einstellung den Dezimalpunkt. Die Anpassung ist dann nicht nötig, schadet aber auch nicht.

CircuitPython and Fedora

The season of long winter nights is coming, so I got myself an AdaFruit Circuit Playground Express for some home decoration.

My plan is to program it using CircuitPython, a MicroPython derivate that is adapted to the AdaFruit hardware.

CircuitPython must be installed to the Circuit Playground first, which turned out to be difficult with Fedora Linux in a first attempt. The troublemaker was the ModemManager, which is still installed by default. It detects the serial port of the AdaFruit device, and then hogs this resource because, well, it might be a modem. 🙄

My older readers certainly still remember what a modem is. 😉 But to make a long story short, almost no one is using a serial modem nowadays, so the ModemManager does not serve any useful purpose. However, it cannot be removed, because other important packages still depend on it. The only way is to stop it permanently:

sudo systemctl stop ModemManager
sudo systemctl disable ModemManager

After that, I could finally install CircuitPython to the Circuit Playground. First I downloaded the matching uf2 file. After that, I connected the Playground via USB, and changed to the bootloader mode by pressing its reset button twice (like a double-click).

The Circuit Playground is now mounted as an USB drive called CPLAYBOOT. All there is to do now is to copy the uf2 file to this drive. The Playground automatically reboots after that. If everything went fine, it will come back as an USB drive called CIRCUITPY.

The next step is to install the AdaFruit libraries to that drive. I downloaded the latest library bundle that matched my CircuitPython version, and just unpacked it to the CIRCUITPY drive.

That's it... All there is to do now, is to open the code.py file in an editor and change the code. It is immediately executed when it is saved.

For a start, there are a lot of code examples for the Circuit Playground Express on the AdaFruit web site.

Reviving a Sony CDP-991, Part 5

The player is playing again. Time for some final cleanings.

Fifth Problem: Crackling Volume Pot

The volume assembly with the pots on the left. Just spray into the hole. After the calibration part, this is going to be a walk in the park. Or so I thought.

On the CDP-991, the playback volume can be changed via remote control. There's a motor that actually drives the volume knob and the potentiometers. The custom file feature allows to store individual volume settings for different CDs.

Due to the construction with the pots and the motor, the volume control assembly is rather big and is mounted to the front panel with screws. I removed the screws and the volume knob, but still could not remove the assembly for cleaning. It was still fixed somewhere else. The service manual gave no hint about how to remove it.

So I just tried my luck and sprayed some contact cleaner into the holes of the three pots close to the front. It worked, and saved me from finding a way to remove the assembly.

And that's it... I closed the case and polished it with a microfiber cloth and a soft cleaner. Then I put batteries into the remote control.

Welcome back to the living room, my good old CD player! 😀

Retrospective

Looking back, I am surprised how much is still working and in a good shape after 27 years. I am also surprised that I could still get a good service manual, and all the necessary replacement parts.

For most parts of the restauration, I just needed a screwdriver, cotton buds, isopropanol, and grease. So basically it can be done by anyone who isn't all thumbs. Just the pickup replacement and the calibration needs more elaborate equipment.

Reviving a Sony CDP-991, Part 4

The CD player finally plays music again, but still has trouble with the higher tracks.

Fourth Problem: Worn out Laser

Let's find out how worn out the laser actually is. I soldered a wire to the RF test point and connected it to a scope.

The service manual recommends to use a special test CD, but you can use any CD for the RF test. I found out that older CDs gave better results, probably because modern production methods are cheaper and less reflective. Do not use CD-R, as these discs use a dye and are not as reflective as standard CDs.

According to the service manual, the signal should have an amplitude of about 1.2Vpp (+0.2V, -0.4V).

The actual amplitude is just above 600mVpp, far below the required minimum of 800mVpp.

The first thing one should try now is to clean the lens. I used a cotton bud and 100% isopropanol for that. After that, the amplitude was a little better with about 880mVpp, but still at the minimum.

I could now recalibrate the player and try to get the best out of it.

But honestly, a new optical pickup module for this player can be ordered at the Bay for less than €20. It's not genuine, since Sony is not producing the KSS-240A any more. But I am curious how good that remake actually is. If it should be worse, I could still continue to use the original one.

The optical pickup is very sensitive to static discharge. If you try the replacement at home, use an antistatic wrist strap and other ESD protective measures while handling it!

The replacement of the pickup was much easier than expected. Only a plastic clip is holding the metal shaft of the sled in place, so it could easily be pulled out. After that, I could remove the old pickup.

And while I was at it, I thoroughly cleaned the shaft and the plastic parts from the old grease again, and reapplied a bit of fresh silicone grease. I also applied a little bit of grease to the gears that are moving the sled.

Then I inserted the new pickup and fixed it with the shaft. The first test with the new pickup brought good news, and bad news. The good news is that the replica pickup is working, and the RF amplitude is even above the 1.4Vpp upper limit now.

The bad news is that the drive was making a loud and awful whistling noise now. So I recalibrated the player as described in this restauration project of a similar player.

The calibration was successful. The whistling noise is gone (except on track changes), and the player plays all the tracks again. I am sure an experienced technician can calibrate it a lot better, but I'm happy with the result.

And thanks to my proper cleaning, the sled noises are also much better. By all means good enough considering the age of the player.

I'm almost done! There's just a tiny problem left: The crackling volume pot.