Skip to content

Commit

Permalink
replace sks-keyservers.net by keyserver.ubuntu.com
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jun 25, 2021
1 parent 7f33013 commit 067a56e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/it/keyServerList-fallBack/pom-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<pgpKeyServerLoadBalance>false</pgpKeyServerLoadBalance>
<pgpKeyServer>
http://wrong.address.example.com
https://hkps.pool.sks-keyservers.net
hkps://keyserver.ubuntu.com
</pgpKeyServer>
</configuration>
</plugin>
Expand Down
6 changes: 3 additions & 3 deletions src/it/keyServerList-fallBack/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
def buildLog = new File( basedir, 'build.log' )

assert buildLog.text.contains('[INFO] Key server(s) - fallback list: [{http://wrong.address.example.com}, {https://hkps.pool.sks-keyservers.net}]')
assert buildLog.text.contains('[INFO] Key server(s) - fallback list: [{http://wrong.address.example.com}, {https://keyserver.ubuntu.com}]')
assert buildLog.text.contains('[WARNING] {http://wrong.address.example.com} throw exception: UnknownHostException: wrong.address.example.com for: http://wrong.address.example.com/pks/lookup?op=get&options=mr&search=0xEFE8086F9E93774E - fallback try next client')
assert buildLog.text.contains('[INFO] Receive key: https://hkps.pool.sks-keyservers.net/pks/lookup?op=get&options=mr&search=0xEFE8086F9E93774E')
assert buildLog.text.contains('[INFO] Receive key: https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0xEFE8086F9E93774E')

assert buildLog.text.contains('[WARNING] {http://wrong.address.example.com} throw exception: UnknownHostException: wrong.address.example.com for: http://wrong.address.example.com/pks/lookup?op=get&options=mr&search=0xA6ADFC93EF34893E - fallback try next client')
assert buildLog.text.contains('[INFO] Receive key: https://hkps.pool.sks-keyservers.net/pks/lookup?op=get&options=mr&search=0xA6ADFC93EF34893E')
assert buildLog.text.contains('[INFO] Receive key: https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0xA6ADFC93EF34893E')

assert buildLog.text.contains('[INFO] junit:junit:pom:4.12 PGP Signature OK')
assert buildLog.text.contains('[INFO] junit:junit:jar:4.12 PGP Signature OK')
Expand Down
3 changes: 2 additions & 1 deletion src/it/keyServerList-loadBalance/pom-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
</executions>
<configuration>
<pgpKeysCachePath>${project.build.directory}/pgpkeys-cache</pgpKeysCachePath>
<pgpKeyServer>https://hkps.pool.sks-keyservers.net; https://keyserver.ubuntu.com</pgpKeyServer>
<pgpKeyServer>https://keyserver.ubuntu.com,https://keys.openpgp.org</pgpKeyServer>
<pgpKeyServerLoadBalance>true</pgpKeyServerLoadBalance>
</configuration>
</plugin>
</plugins>
Expand Down
8 changes: 4 additions & 4 deletions src/it/keyServerList-loadBalance/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
*/
def buildLog = new File( basedir, 'build.log' )

assert buildLog.text.contains('[INFO] Key server(s) - load balance list: [{https://hkps.pool.sks-keyservers.net}, {https://keyserver.ubuntu.com}]')
assert buildLog.text.contains('[INFO] Receive key: https://hkps.pool.sks-keyservers.net/pks/lookup')
assert buildLog.text.contains('[INFO] Key server(s) - load balance list: [{https://keyserver.ubuntu.com}, {https://keys.openpgp.org}]')
assert buildLog.text.contains('[INFO] Receive key: https://keys.openpgp.org/pks/lookup')
assert buildLog.text.contains('[INFO] Receive key: https://keyserver.ubuntu.com/pks/lookup')

assert buildLog.text.contains('[INFO] junit:junit:pom:4.12 PGP Signature OK')
assert buildLog.text.contains('[INFO] junit:junit:jar:4.12 PGP Signature OK')
assert buildLog.text.contains('SubKeyId: 0xD4C89EA4AAF455FD88B22087EFE8086F9E93774E of 0x58E79B6ABC762159DC0B1591164BD2247B936711 UserIds: [Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>]')
assert buildLog.text.contains('SubKeyId: 0xD4C89EA4AAF455FD88B22087EFE8086F9E93774E of 0x58E79B6ABC762159DC0B1591164BD2247B936711')

assert buildLog.text.contains('[INFO] org.hamcrest:hamcrest-core:pom:1.3 PGP Signature OK')
assert buildLog.text.contains('[INFO] org.hamcrest:hamcrest-core:jar:1.3 PGP Signature OK')
assert buildLog.text.contains('KeyId: 0x4DB1A49729B053CAF015CEE9A6ADFC93EF34893E UserIds: [Tom Denley (scarytom) <t.denley@cantab.net>]')
assert buildLog.text.contains('KeyId: 0x4DB1A49729B053CAF015CEE9A6ADFC93EF34893E')

assert buildLog.text.contains('[INFO] BUILD SUCCESS')
1 change: 1 addition & 0 deletions src/it/noKeyFail/pom-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<version>@project.version@</version>
<configuration>
<keysMapLocation>${project.basedir}/keysmap.list</keysMapLocation>
<pgpKeyServer>hkps://keyserver.ubuntu.com</pgpKeyServer>
</configuration>
<executions>
<execution>
Expand Down
4 changes: 2 additions & 2 deletions src/it/noKeyFail/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
def buildLog = new File( basedir, 'build.log' ).text


assert buildLog.contains('[ERROR] PGP key https://hkps.pool.sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&search=0x466583F9480EBE2462C46B309F1A263E15FD0AC9 not found on keyserver for artifact nl.dannyvanheumen:helloworld:jar:1.0')
assert buildLog.contains('[ERROR] PGP key https://hkps.pool.sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&search=0x466583F9480EBE2462C46B309F1A263E15FD0AC9 not found on keyserver for artifact nl.dannyvanheumen:helloworld:pom:1.0')
assert buildLog.contains('[ERROR] PGP key https://keyserver.ubuntu.com/pks/lookup?op=vindex&fingerprint=on&search=0x466583F9480EBE2462C46B309F1A263E15FD0AC9 not found on keyserver for artifact nl.dannyvanheumen:helloworld:jar:1.0')
assert buildLog.contains('[ERROR] PGP key https://keyserver.ubuntu.com/pks/lookup?op=vindex&fingerprint=on&search=0x466583F9480EBE2462C46B309F1A263E15FD0AC9 not found on keyserver for artifact nl.dannyvanheumen:helloworld:pom:1.0')
assert buildLog.contains('[INFO] BUILD FAILURE')
1 change: 1 addition & 0 deletions src/it/noKeyOK/pom-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<version>@project.version@</version>
<configuration>
<keysMapLocation>${project.basedir}/keysmap.list</keysMapLocation>
<pgpKeyServer>hkps://keyserver.ubuntu.com</pgpKeyServer>
</configuration>
<executions>
<execution>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/simplify4u/plugins/AbstractPGPMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public abstract class AbstractPGPMojo extends AbstractMojo {
* @since 1.0.0
*/
@Parameter(property = "pgpverify.keyserver", required = true,
defaultValue = "hkps://hkps.pool.sks-keyservers.net,hkps://keyserver.ubuntu.com")
defaultValue = "hkps://keyserver.ubuntu.com")
private String pgpKeyServer;

/**
Expand Down Expand Up @@ -100,7 +100,7 @@ public abstract class AbstractPGPMojo extends AbstractMojo {
*
* @since 1.7.0
*/
@Parameter(property = "pgpverify.keyserversLoadBalance", defaultValue = "true")
@Parameter(property = "pgpverify.keyserversLoadBalance", defaultValue = "false")
private boolean pgpKeyServerLoadBalance;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ public class PGPKeysServerClientIT {
@DataProvider(name = "goodServerUrls")
Object[][] goodServerUrls() {
return new Object[][]{
{"hkp://pool.sks-keyservers.net"},
{"hkp://p80.pool.sks-keyservers.net:80"},
{"http://p80.pool.sks-keyservers.net"},
{"hkp://keyserver.ubuntu.com/"},
{"hkps://keyserver.ubuntu.com/"},
{"hkps://hkps.pool.sks-keyservers.net"}
};
}

Expand Down Expand Up @@ -114,7 +111,6 @@ public void setupMockServer() {

mavenSession = mock(MavenSession.class);
when(mavenSession.getSettings()).thenReturn(mock(Settings.class));

}

@AfterClass(alwaysRun = true)
Expand Down

0 comments on commit 067a56e

Please sign in to comment.