<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:00 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-821] Mounting a device does not work when multiple TLS Certificates are present </title>
                <link>https://jira.opendaylight.org/browse/NETCONF-821</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Configured netconf-keystore model with 2 sets of keystores. Following scenarios were tried out -&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Both sets are the same i.e, There are 2 key-id values - ODL_private_key_0 and ODL_private_key_1 and both have the same values&#160; - In such a scenario, mounting of a device using either keys was successful.&lt;/li&gt;
	&lt;li&gt;One is a valid key and the other is invalid i.e., the valid set (client.key, client.crt and trustedCertificates.crt) was taken, a copy of it was made and the client.crt was edited to include some invalid data. Both sets (valid and invalid) were used to create entries in the netconf-keystore. In this scenario, mounting a device with either of the keys is unsuccessful. The following is the exception in the karaf.log -&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;2021-09-14T04:58:18,310 | INFO | nioEventLoopGroupCloseable-3-10 | AbstractNetconfSessionNegotiator | 352 - org.opendaylight.netconf.netty-util - 1.13.2 | - | Unexpected error during negotiation
java.lang.IllegalStateException: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input
 at org.opendaylight.netconf.sal.connect.util.SslHandlerFactoryImpl.createSslHandler(SslHandlerFactoryImpl.java:82) ~[bundleFile:?]
 at org.opendaylight.netconf.sal.connect.util.SslHandlerFactoryImpl.createSslHandler(SslHandlerFactoryImpl.java:45) ~[bundleFile:?]
 at org.opendaylight.netconf.client.TlsClientChannelInitializer$ChannelActiveSentry.channelActive(TlsClientChannelInitializer.java:56) ~[bundleFile:?]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230) [bundleFile:4.1.63.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216) [bundleFile:4.1.63.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209) [bundleFile:4.1.63.Final]
 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398) [bundleFile:4.1.63.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230) [bundleFile:4.1.63.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216) [bundleFile:4.1.63.Final]
 at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:707) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [bundleFile:4.1.63.Final]
 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [bundleFile:4.1.63.Final]
 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [bundleFile:4.1.63.Final]
 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.63.Final]
 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.63.Final]
 at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input
 at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source) ~[?:?]
 at java.security.cert.CertificateFactory.generateCertificate(Unknown Source) ~[?:?]
 at org.opendaylight.netconf.sal.connect.netconf.sal.NetconfKeystoreAdapter.getCertificateChain(NetconfKeystoreAdapter.java:159) ~[bundleFile:?]
 at org.opendaylight.netconf.sal.connect.netconf.sal.NetconfKeystoreAdapter.getJavaKeyStore(NetconfKeystoreAdapter.java:113) ~[bundleFile:?]
 at org.opendaylight.netconf.sal.connect.util.SslHandlerFactoryImpl.createSslHandler(SslHandlerFactoryImpl.java:51) ~[bundleFile:?]
 ... 19 more
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expectation - When the key-id from the valid set is used, mounting of the device should be successful.&lt;/p&gt;</description>
                <environment></environment>
        <key id="34451">NETCONF-821</key>
            <summary>Mounting a device does not work when multiple TLS Certificates are present </summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="3" iconUrl="https://jira.opendaylight.org/images/icons/statuses/inprogress.png" description="This issue is being actively worked on at the moment by the assignee.">In Progress</status>
                    <statusCategory id="4" key="indeterminate" colorName="yellow"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="rkashapov">Ruslan Kashapov</assignee>
                                    <reporter username="pendurty">Ravi Pendurty</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Wed, 15 Sep 2021 05:38:27 +0000</created>
                <updated>Mon, 22 Jan 2024 21:59:48 +0000</updated>
                                            <version>1.13.2</version>
                                    <fixVersion>7.0.0</fixVersion>
                    <fixVersion>6.0.7</fixVersion>
                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="70342" author="JIRAUSER14303" created="Thu, 9 Dec 2021 10:05:57 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=pendurty&quot; class=&quot;user-hover&quot; rel=&quot;pendurty&quot;&gt;pendurty&lt;/a&gt;, Can you please refer further details about issue:&lt;br/&gt;
 1. What is the type of device in which you wanted to create mount point?&lt;br/&gt;
 2. What is the version of ONAP where you found out issue?&lt;br/&gt;
 &#160; &#160; I assume you have been following this guide:&#160;&lt;br/&gt;
 &#160; &#160; &lt;a href=&quot;https://docs.onap.org/projects/onap-sdnc-oam/en/istanbul/cert_installation.html,&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.onap.org/projects/onap-sdnc-oam/en/istanbul/cert_installation.html,&lt;/a&gt;&#160;where is&lt;br/&gt;
&#160; &#160; mentioned:&#160;&lt;br/&gt;
&#160; &#160; &quot;Client.crt represents the client certificate and the client.key is the private key that is to be&lt;br/&gt;
&#160; &#160; used.&#160;Only a single client/client cert is supported as of the Dublin release and multiple clients&lt;br/&gt;
&#160; &#160; are not supported.&quot;&lt;br/&gt;
 3.&#160;If you do not use ONAP, which requests have you issued with ODL RESTCONF/NETCONF?&lt;/p&gt;</comment>
                            <comment id="70343" author="JIRAUSER13146" created="Thu, 9 Dec 2021 11:09:08 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=ivanm1996&quot; class=&quot;user-hover&quot; rel=&quot;ivanm1996&quot;&gt;ivanm1996&lt;/a&gt; ,&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;What is the type of device in which you wanted to create mount point?&#160; &lt;span class=&quot;error&quot;&gt;&amp;#91;RAVI&amp;#93;&lt;/span&gt; I was trying on an O-RAN device. It supports NETCONF&lt;/li&gt;
	&lt;li&gt;What is the version of ONAP where you found out issue? - Honolulu and Istanbul. Yes I have seen the guide earlier. However releases after Dublin support multiple zip files to be provided and the InstallCerts.py script ([https://gerrit.onap.org/r/gitweb?p=sdnc/oam.git;a=blob;f=installation/sdnc/src/main/scripts/installCerts.py) installs multiple keys into the netconf-keystore.&lt;/li&gt;
	&lt;li&gt;I used SDNC component to issue the requests to ODL&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I believe using ONAP is not the problem. When there are multiple keys configured in the netconf-keystore model, ODL fails to mount even though a valid key is passed while creating the mountpoint.&lt;/p&gt;</comment>
                            <comment id="70344" author="ivanhrasko" created="Thu, 9 Dec 2021 11:25:47 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=pendurty&quot; class=&quot;user-hover&quot; rel=&quot;pendurty&quot;&gt;pendurty&lt;/a&gt; what do you mean by &quot; was edited to include some invalid data&quot;? Was it still valid certificate?&lt;/p&gt;</comment>
                            <comment id="70345" author="ivanhrasko" created="Thu, 9 Dec 2021 11:26:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=pendurty&quot; class=&quot;user-hover&quot; rel=&quot;pendurty&quot;&gt;pendurty&lt;/a&gt; How did you specify which key should be used when mounting a device? Can you provide requests/steps to reproduce?&lt;/p&gt;</comment>
                            <comment id="70346" author="JIRAUSER13146" created="Thu, 9 Dec 2021 13:02:11 +0000"  >&lt;p&gt;Instead of creating a new valid certificate, I replicated an existing certificate and edited it. The edited certificate is not valid, however the basic structure of the certificate is intact, i.e., it is enclosed between&#160; ----&lt;del&gt;BEGIN CERTIFICATE&lt;/del&gt;---- and ----&lt;del&gt;END CERTIFICATE&lt;/del&gt;---- but the contents in between are modified.&lt;/p&gt;</comment>
                            <comment id="70347" author="JIRAUSER13146" created="Thu, 9 Dec 2021 13:04:36 +0000"  >&lt;p&gt;Following is the request URL and the payload -&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://172.18.0.3:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=TLS_Device&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://172.18.0.3:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=TLS_Device&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Payload - (The key is specified in the &amp;lt;key-id&amp;gt; element. This key is added to the netconf-keystore model using the installCerts.py script that I shared earlier)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;node xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&lt;/span&gt;&amp;gt;
 &amp;lt;node-id&amp;gt;TLS_Device&amp;lt;/node-id&amp;gt;
 &amp;lt;key-based xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;
 &amp;lt;key-id xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;ODL_private_key_0&amp;lt;/key-id&amp;gt;
 &amp;lt;username xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;netconf&amp;lt;/username&amp;gt;
 &amp;lt;/key-based&amp;gt;
 &amp;lt;host xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;172.18.0.4&amp;lt;/host&amp;gt;
 &amp;lt;port xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;831&amp;lt;/port&amp;gt;
 &amp;lt;tcp-only xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&amp;lt;/tcp-only&amp;gt;
 &amp;lt;protocol xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;
 &amp;lt;name xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;TLS&amp;lt;/name&amp;gt; 
 &amp;lt;/protocol&amp;gt;
 &amp;lt;max-connection-attempts xmlns=&lt;span class=&quot;code-quote&quot;&gt;&quot;urn:opendaylight:netconf-node-topology&quot;&lt;/span&gt;&amp;gt;2&amp;lt;/max-connection-attempts&amp;gt;
&amp;lt;/node&amp;gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="72904" author="JIRAUSER13216" created="Tue, 5 Dec 2023 11:19:26 +0000"  >&lt;p&gt;Few issues here&#160;&lt;/p&gt;

&lt;p&gt;While key-based/key-id is eligible option in topology node configuration the purpose of this option is key based authentication for SSH transport, not TLS. It means the key-id value is ignored if protocol value is TLS. See &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/82a4a9b7371aa8e8f4a13aef73cafb75891d568f/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/DefaultNetconfClientConfigurationBuilderFactory.java#L73&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DefaultNetconfClientConfigurationBuilderFactory&lt;/a&gt; invoking &lt;a href=&quot;https://github.com/opendaylight/netconf/blob/82a4a9b7371aa8e8f4a13aef73cafb75891d568f/plugins/netconf-client-mdsal/src/main/java/org/opendaylight/netconf/client/mdsal/impl/DefaultSslHandlerFactoryProvider.java#L152&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DefaultSslHandlerFactoryProvider&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While no specific key is expected on per device basis the SslHandler is built based on KeyStore instance containing ALL the configured keys and trusted certificates. Upon KeyStore preparation all the defined private keys and certificates are parsed from binary form into Java objects. As result any single invalid (non-parseable) entry will cause SslHandler build failure for every TLS device unless this entry is removed from datastore.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="37711">NETCONF-1205</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="17202" name="[NETCONF-821] Steps to reproduce.rtf" size="94637" author="ivanm1996" created="Mon, 3 Jan 2022 12:12:40 +0000"/>
                            <attachment id="17203" name="files.zip" size="18022" author="ivanm1996" created="Mon, 3 Jan 2022 12:12:40 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03zk7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>