Index: /applications/editors/josm/plugins/http2/src/org/openstreetmap/josm/plugins/http2/Http2Client.java
===================================================================
--- /applications/editors/josm/plugins/http2/src/org/openstreetmap/josm/plugins/http2/Http2Client.java	(revision 35426)
+++ /applications/editors/josm/plugins/http2/src/org/openstreetmap/josm/plugins/http2/Http2Client.java	(revision 35427)
@@ -13,4 +13,5 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandlers;
+import java.time.DateTimeException;
 import java.time.Duration;
 import java.time.Instant;
@@ -175,16 +176,21 @@
         @Override
         public long getExpiration() {
-            return response.headers().firstValue("Expires")
-                    .map(DateTimeFormatter.RFC_1123_DATE_TIME::parse)
-                    .map(t -> 1000L * t.getLong(ChronoField.INSTANT_SECONDS))
-                    .orElse(0L);
+            return parseDate(response.headers().firstValue("Expires").orElse(null));
         }
 
         @Override
         public long getLastModified() {
-            return response.headers().firstValue("Last-Modified")
-                    .map(DateTimeFormatter.RFC_1123_DATE_TIME::parse)
-                    .map(t -> 1000L * t.getLong(ChronoField.INSTANT_SECONDS))
-                    .orElse(0L);
+            return parseDate(response.headers().firstValue("Last-Modified").orElse(null));
+        }
+
+        static long parseDate(String string) {
+            if (string != null) {
+                try {
+                    return DateTimeFormatter.RFC_1123_DATE_TIME.parse(string).getLong(ChronoField.INSTANT_SECONDS) * 1000L;
+                } catch (DateTimeException e) {
+                    Logging.debug(e);
+                }
+            }
+            return 0L;
         }
 
Index: /applications/editors/josm/plugins/http2/test/org/openstreetmap/josm/plugins/http2/Http2ClientTest.java
===================================================================
--- /applications/editors/josm/plugins/http2/test/org/openstreetmap/josm/plugins/http2/Http2ClientTest.java	(revision 35427)
+++ /applications/editors/josm/plugins/http2/test/org/openstreetmap/josm/plugins/http2/Http2ClientTest.java	(revision 35427)
@@ -0,0 +1,32 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.http2;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openstreetmap.josm.plugins.http2.Http2Client.Http2Response;
+
+/**
+ * Unit test of {@link Http2Client}
+ */
+public class Http2ClientTest {
+
+    /**
+     * Unit test of {@link Http2Response#parseDate}
+     */
+    @Test
+    public void testParseDate() {
+        assertEquals(786297600000L, Http2Response.parseDate("Thu, 01 Dec 1994 16:00:00 GMT"));
+        assertEquals(783459811000L, Http2Response.parseDate("Sat, 29 Oct 1994 19:43:31 GMT"));
+        assertEquals(784903526000L, Http2Response.parseDate("Tue, 15 Nov 1994 12:45:26 GMT"));
+        // == RFC 2616 ==
+        // All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception.
+        assertEquals(0L, Http2Response.parseDate("Thu, 01 Jan 1970 01:00:00 CET"));
+        // == RFC 2616 ==
+        // HTTP/1.1 clients and caches MUST treat other invalid date formats,
+        // especially including the value "0", as in the past (i.e., "already
+        // expired").
+        assertEquals(0L, Http2Response.parseDate("0"));
+        assertEquals(0L, Http2Response.parseDate("foo-bar"));
+    }
+}
