From 46b02c66407e26f95cf20dd384061d325b80b736 Mon Sep 17 00:00:00 2001 From: Sam Byng Date: Fri, 28 Apr 2023 18:29:38 +0100 Subject: [PATCH] Issue 203: Update the truststore/keystore for stream-tests (#301) * Update the stream-tests truststore/keystore to refer to pekko-remote The same truststore/keyspace as the one generate with the Makefile at remote/src/test/resources is used here" * Revert "Update the stream-tests truststore/keystore to refer to pekko-remote" This reverts commit 7bab689bb6257e80d2bd8cdff2b8a715bb08c619. * Issue 203: Update keystore/truststore for stream-tests: Note that no SAN extension file is used in this case. Therefore the verify hostname code looks at the CN= instead of the subjectAltName field. I've added a Makefile here to make it easier to regenerate this in future: just delete the trust/keystores and run 'make' * 203: Add comment explaining new Makefile --- stream-tests/src/test/resources/Makefile | 19 ++++++++++++++++++ stream-tests/src/test/resources/keystore | Bin 1342 -> 2397 bytes stream-tests/src/test/resources/truststore | Bin 637 -> 857 bytes .../pekko/stream/io/DeprecatedTlsSpec.scala | 2 +- .../org/apache/pekko/stream/io/TlsSpec.scala | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 stream-tests/src/test/resources/Makefile diff --git a/stream-tests/src/test/resources/Makefile b/stream-tests/src/test/resources/Makefile new file mode 100644 index 0000000000..068a75523f --- /dev/null +++ b/stream-tests/src/test/resources/Makefile @@ -0,0 +1,19 @@ +# Documents how truststore and keystore were created +# A similar Makefile is found in remote/src/test/resources/, however here the cert is created without specifying a Subject Alternate Name +all: truststore keystore + +truststore: domain.crt + keytool -importcert -file domain.crt -keystore truststore -deststorepass changeme + +keystore: domain.crt domain.key + openssl pkcs12 -export -inkey domain.key -passin pass:changeme -in domain.crt -out keystore -passout pass:changeme + +domain.crt: domain.csr domain.key + openssl x509 -req -in domain.csr -sha256 -out domain.crt -signkey domain.key + +domain.csr: + openssl req -new -newkey rsa:2048 -keyout domain.key -subj "/C=US/ST=Delaware/O=Apache/CN=pekko-remote" -out domain.csr -passout pass:changeme + +.PHONY: clean +clean: + rm domain.key domain.crt domain.csr keystore truststore \ No newline at end of file diff --git a/stream-tests/src/test/resources/keystore b/stream-tests/src/test/resources/keystore index ee5581d930a1cb38981f2a547aab3acf24861e71..2b0237562b4aa1a7f9042997d976b4adfc75d144 100644 GIT binary patch literal 2397 zcmXqL;*4ZsWHxBxlxO4AYV&CO&dbQoxS)wsfTf9($DoOm!=QZ?Y+O(ico^9X_*gi?Ib0<}JFiY+V&Y(EXkxCg%eddQb$etbT zX)#UfeNL#j99OaN_%QiN$iKXM`pYd2U3oEKzpG)htx-P9qeputn6$Ru)D#TVJ}$aY zK4quFG?T!$A$iZrb}zeEJKMY?V%Oyfb7N-loVm89J(kZpFTg}H_)AGfhQh%PKL*{S zQyZ49|DLmfyGCca&i(=;tu({cZ8ORjnb>@PS?E_~!*WdZl6ccKn-^D(zMmx0Gv%B8 zz1eRbGpLeGnVE{bXwEpQ5GCJ~7P_!~uISdlV}I{d^S+%mdz+n> z@=CT%`VWs*iQn2XDQ5#mU6R_FXDyrSzyA|hbK&!s-X(9P4{S*gy}Db(SYG*cYS-uW zmuD(>hHU-gsQY!w%a@b7+~1WaN{>22&`N?AXBzgW2_uK#=S*ZK^8DGTiok7%u)qbZ-3 zRaM8QzR>TFHNNY_nz3&-r-OjLgxZ%@3qA;wLD~w|l-trhwzzi8a~1jNL^Yjtdht+Rk76oPM`# zv)?R_^=%9bF33AxKf!Wr?QW)h^Sy*U?o~=DzRH_6o8#4@oYUq``_#|7MS8w^U2w#* zW&pJvV6y5TkV|6hwfuZvh_QoP=`=!fIpwn^9cZ*1jV;^JEtG@CcA zv;L}q@M?ccm5!)siyChFzxw@Obju7oBj&;_eFn}q)UUtTC$la;HuZHsn>^!9Nw=sy z37ksyB@t7%tZ8r8nkD=^ZM(5%MnOUJQ<2>s>m+Zwyl^q)pSkz^1)*wl_V0D6TCDTS zoug+<7v9#K?fb!+V`IRAhca6ttVS$N zta=7btXc+5tZHoBux!i4$h4q|<()wj%PW-J%nZuS`;RTM5)p230Oe+uCYBSoFUq@I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a/stream-tests/src/test/resources/truststore b/stream-tests/src/test/resources/truststore index cc07616dad6cd4bb2833468ee5b4e6bf79b62b97..3cc1983600897997df7958c8591fe7eabb079248 100644 GIT binary patch literal 857 zcmezO_TO6u1_mYu1_nkj&6-=8om$Djz}SAsZ0#`y)(AaQ14{-5W@&>aW^sci#{Wzr z5?pc)`=+!@o?!p^0h&tTBR$i>ve$jESp#qgKD z$(g6kYo0DHl$f*j#+hDWzPeW%_fP+}oL5fG@yeO$&Re$@ZIo@9wKO)sr1|yr$1k=C z|59FUs&PN({%6a%)zRi_|J&c56C`tE2Yc)LhAr_IzH~)Pc6>c$mwMc4_VvWXYSXhp zcY6x#?sx^8x|x64`G2vS#CQ4sf4zO4O>&(lVYAV61;5P1>&k@z+VRV#oU7g}@mqW4 z`uyv^?bRKhf0CclC>NUcXF|2bhFdjh%*!@1_1;pbmD@bu>goCmfx+*8#V@H$I9tEt z%yPzwzuM9qUR+km{=EE)RfO!3ADgF`TPg-uCZ7|3##;9BQpWVA{KI^FM`dgt)c%+( zSjZXa!t_E{m!`)_D@NfDR6!2t_wK@rlB8ti$n_K^5zL~PwI|R^HH70x$@Au6Y@!8q$^6&4{`XSLF_H9{TduF{`gFMJ>jOR)iD=Ko z%dQ@;?Q?6EW}GrhvUbvjpB9a8@1I*LsUI literal 637 zcmezO_TO6u1_mYu1_nkj&6-=8om$Djz-WHDxleOoi}O4j*SmyZI*pDL9+MXnT~_kCWh?bdNV(Z`I3X! z8M&En`>OWt6!1`BzulE3U$yv>r?$RYLB!vq+tusGLU{li^m(FSFv zcJh}Z!gakC&YSH$Dq51hHg}QgTH^`-7oL^i+^@&VxzKTvSwMBYx2U(gzo&W#< diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala index 168d8d62ba..e16d8bda64 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/DeprecatedTlsSpec.scala @@ -526,7 +526,7 @@ class DeprecatedTlsSpec extends StreamSpec(DeprecatedTlsSpec.configOverrides) wi Source.single(SendBytes(ByteString.empty)).via(flow).runWith(Sink.ignore) } - Await.result(run("akka-remote"), 3.seconds) // CN=akka-remote + Await.result(run("pekko-remote"), 3.seconds) // CN=pekko-remote val cause = intercept[Exception] { Await.result(run("unknown.example.org"), 3.seconds) } diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsSpec.scala index 871c54dffd..415eababc2 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/io/TlsSpec.scala @@ -574,7 +574,7 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing Source.single(SendBytes(ByteString.empty)).via(flow).runWith(Sink.ignore) } - Await.result(run("akka-remote"), 3.seconds) // CN=akka-remote + Await.result(run("pekko-remote"), 3.seconds) // CN=pekko-remote val cause = intercept[Exception] { Await.result(run("unknown.example.org"), 3.seconds) }