{"id":5403,"date":"2020-05-26T22:50:46","date_gmt":"2020-05-27T02:50:46","guid":{"rendered":"https:\/\/microdevsys.com\/wp\/?p=5403"},"modified":"2020-05-26T22:53:27","modified_gmt":"2020-05-27T02:53:27","slug":"cloudera-and-azure-wronghost-peer-certificate-subjectaltname-does-not-match-host-expected-got-dnshost01-dom-com-dnshost02-dom-com-dnshost03-dom-com","status":"publish","type":"post","link":"https:\/\/microdevsys.com\/wp\/cloudera-and-azure-wronghost-peer-certificate-subjectaltname-does-not-match-host-expected-got-dnshost01-dom-com-dnshost02-dom-com-dnshost03-dom-com\/","title":{"rendered":"Cloudera and Azure: WrongHost: Peer certificate subjectAltName does not match host, expected <HOST>, got DNS:host01.dom.com, DNS:host02.dom.com, DNS:host03.dom.com"},"content":{"rendered":"<p>\n\tSo you&#39;re getting this while trying to connect Cloud Hosts to your local Cloudera Infrastructure?\n<\/p>\n<pre style=\"margin-left: 40px;\">\r\n<span style=\"font-family:courier new,courier,monospace;\"><code>WrongHost: Peer certificate subjectAltName does not match host, expected dhcp-100-0-0-100.remote.user.isp.com, got DNS:srv-c01.cdh.local.hst, DNS:cm-r01nn01.cdh.local.hst, DNS:cm-r01nn02.cdh.local.hst<\/code><\/span><\/pre>\n<p>\n\t<!--more-->\n<\/p>\n<p>\n\tThe reason for this is that Cloudera reconfigured your Agent config.ini to use the hostname derived from the IP address that is used to login to the remote machine.&nbsp;This is done while adding a new node.&nbsp; The script that does this is below:&nbsp;&nbsp;\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">[root@cm-awn01 scm_prepare_node.pFWkTK2i]# ls -altri<br \/>\n\ttotal 152<br \/>\n\t&nbsp;67410958 -rwxr-xr-x &nbsp; 1 cdhroot cdhroot 49327 May 25 00:27 <span style=\"color:#008000;\"><strong>scm_prepare_node.sh<\/strong><\/span><br \/>\n\t&nbsp;67410959 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;3023 May 25 00:27 US_export_policy.jar.8<br \/>\n\t&nbsp;67410960 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;3035 May 25 00:27 local_policy.jar.8<br \/>\n\t&nbsp;67410961 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot 13155 May 25 00:27 customGPG<br \/>\n\t&nbsp;67410962 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp; &nbsp;63 May 25 00:27 packages.scm<br \/>\n\t&nbsp;67410963 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp; &nbsp;63 May 25 00:27 always_install.scm<br \/>\n\t&nbsp;67410964 -rw-r&#8211;r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp; &nbsp;15 May 25 00:27 x86_64_packages.scm<br \/>\n\t101634639 drwxrwxr-x &nbsp; 3 cdhroot cdhroot &nbsp; &nbsp;19 May 25 00:27 repos<br \/>\n\t&nbsp;34689507 drwx&#8212;&#8212; &nbsp; 2 cdhroot cdhroot &nbsp; &nbsp;83 May 25 00:27 gnupg.vNKKLRISC9<br \/>\n\t&nbsp;67410966 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;1670 May 25 00:27 F36A89E33CC1BD0F71079007327574EE02A818DD.pub<br \/>\n\t&nbsp;67410967 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;1691 May 25 00:27 5F14D39EF0681ACA6F044A43F90C0D8FE8F86ACD.pub<br \/>\n\t&nbsp;67410968 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;1735 May 25 00:27 9543951160C284C0E7CA254573985D43B0B19C9F.pub<br \/>\n\t&nbsp;67410969 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;3104 May 25 00:27 CECDB80C4E9004B0CFE852962279662784415700.pub<br \/>\n\t&nbsp;67410970 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot &nbsp;5416 May 25 00:27 DF2C4DD7629B1AC08A0966E00F65552736F57F35.pub<br \/>\n\t&nbsp;67410965 -rw-rw-r&#8211; &nbsp; 1 cdhroot cdhroot 20819 May 25 00:27 scm_prepare_node.log<br \/>\n\t&nbsp;67410957 drwx&#8212;&#8212; &nbsp; 4 cdhroot cdhroot &nbsp;4096 May 26 21:53 .<br \/>\n\t&nbsp;33554504 drwxrwxrwt. 16 root &nbsp; &nbsp;root &nbsp; &nbsp; 8192 May 26 22:01 ..<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<\/span>\n<\/p>\n<p>\n\tBelow is a sample of it&#39;s log file:\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">[root@cm-awn01 scm_prepare_node.pFWkTK2i]# <strong>cat scm_prepare_node.log<\/strong><br \/>\n\tusing SSH_CLIENT to get the SCM hostname: 100.0.0.100 42572 22<br \/>\n\topening logging file descriptor<br \/>\n\t###CLOUDERA_SCM### SCRIPT_START<br \/>\n\t###CLOUDERA_SCM### TAKE_LOCK<br \/>\n\tBEGIN flock 4<br \/>\n\tEND (0)<br \/>\n\t###CLOUDERA_SCM### DETECT_ROOT<br \/>\n\teffective UID is 1000<br \/>\n\tBEGIN which pbrun<br \/>\n\tEND (1)<br \/>\n\tBEGIN sudo -S id<br \/>\n\twhich: no pbrun in (\/usr\/local\/bin:\/usr\/bin)<br \/>\n\tuid=0(root) gid=0(root) groups=0(root)<br \/>\n\tEND (0)<br \/>\n\tUsing &#39;sudo &#39; to acquire root privileges<br \/>\n\t###CLOUDERA_SCM### DETECT_DISTRO<br \/>\n\tBEGIN grep Tikanga \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep &#39;Scientific Linux release 5&#39; \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep Santiago \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep &#39;CentOS Linux release 6&#39; \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep &#39;CentOS release 6&#39; \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep &#39;Scientific Linux release 6&#39; \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep Maipo \/etc\/redhat-release<br \/>\n\tEND (1)<br \/>\n\tBEGIN grep &#39;CentOS Linux release 7&#39; \/etc\/redhat-release<br \/>\n\tEND (0)<br \/>\n\t\/etc\/redhat-release ==&gt; CentOS 7<br \/>\n\t###CLOUDERA_SCM### DETECT_SCM<br \/>\n\tCentOS Linux release 7.5.1804 (Core)<br \/>\n\t<span style=\"color:#FF0000;\"><strong>BEGIN host -t PTR 100.0.0.100<\/strong><\/span><br \/>\n\t100.0.0.100.in-addr.arpa domain name pointer dhcp-100-0-0-100.cable.user.start.ca.<br \/>\n\tEND (0)<br \/>\n\tusing dhcp-100-0-0-100.cable.user.start.ca as scm server hostname<br \/>\n\tBEGIN which python<br \/>\n\tEND (0)<br \/>\n\t.<br \/>\n\t.<br \/>\n\t.<\/span>\n<\/p>\n<p>\n\tNotice how the reverse lookup of the ISP IP is being shown.&nbsp; We want to ensure the hostname returned is what we have in our SSL \/ TLS Certificates.\n<\/p>\n<p>\n\tTo circumvent this, <strong>dnsmasqerade<\/strong> can be installed to intercept the reverse lookup requests and present the correct hostname the TLS certificate expects.&nbsp; Here is the full config:\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]# host -t PTR 100.0.0.100<br \/>\n\t100.0.0.100.in-addr.arpa domain name pointer srv-c01.mws.mds.xyz.<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]# cat \/etc\/hosts<br \/>\n\t127.0.0.1 &nbsp; localhost localhost.localdomain localhost4 localhost4.localdomain4<br \/>\n\t::1 &nbsp; &nbsp; &nbsp; &nbsp; localhost localhost.localdomain localhost6 localhost6.localdomain6<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">31.25.100.45 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cm-awn01.nix.mds.xyz cm-awn01<br \/>\n\t10.0.0.6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cm-awn01.nix.mds.xyz cm-awn01<br \/>\n\t100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; srv-c01.mws.mds.xyz<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; srv-c01.mws.mds.xyz srv-c01<br \/>\n\t100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; cm-r01nn01.mws.mds.xyz cm-r01nn01<br \/>\n\t100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; cm-r01nn02.mws.mds.xyz cm-r01nn02<br \/>\n\t100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; cm-r01en01.mws.mds.xyz cm-r01en01<br \/>\n\t100.0.0.100 &nbsp; &nbsp; &nbsp; &nbsp; cm-r01en02.mws.mds.xyz cm-r01en02<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]# cat \/etc\/resolv.conf<br \/>\n\t# Generated by NetworkManager<br \/>\n\tsearch 4iktk4qpujwufjkjx511w5ourh.bx.internal.cloudapp.net nix.mds.xyz<br \/>\n\tnameserver 127.0.0.1<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]# cat \/etc\/dnsmasq.conf<br \/>\n\tconf-dir=\/etc\/dnsmasq.d,.rpmnew,.rpmsave,.rpmorig<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">listen-address=::1,127.0.0.1,10.0.0.6<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">interface=eth0<br \/>\n\t# expand-hosts<br \/>\n\t# domain=nix.mds.xyz<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\"># Google&#39;s nameservers<br \/>\n\tserver=123.123.123.123<br \/>\n\tserver=8.8.8.8<br \/>\n\tserver=8.8.4.4<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">address=\/nix.mds.xyz\/127.0.0.1<br \/>\n\taddress=\/nix.mds.xyz\/10.0.0.6<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]# systemctl status dnsmasq<br \/>\n\t? dnsmasq.service &#8211; DNS caching server.<br \/>\n\t&nbsp; &nbsp;Loaded: loaded (\/usr\/lib\/systemd\/system\/dnsmasq.service; enabled; vendor preset: disabled)<br \/>\n\t&nbsp; &nbsp;Active: active (running) since Tue 2020-05-26 22:23:45 EDT; 1min 55s ago<br \/>\n\t&nbsp;Main PID: 4841 (dnsmasq)<br \/>\n\t&nbsp; &nbsp;CGroup: \/system.slice\/dnsmasq.service<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;??4841 \/usr\/sbin\/dnsmasq -k<\/span>\n<\/p>\n<p style=\"margin-left: 40px;\">\n\t<span style=\"font-family:courier new,courier,monospace;\">May 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-c&#8230;inotify<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 8.8.4.4#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 8.8.8.8#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 123.123.123.123#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: reading \/etc\/resolv.conf<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 8.8.4.4#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 8.8.8.8#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: using nameserver 123.123.123.123#53<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: ignoring nameserver 127.0.0.1 &#8211; local interface<br \/>\n\tMay 26 22:23:45 cm-awn01.nix.mds.xyz dnsmasq[4841]: read \/etc\/hosts &#8211; 10 addresses<br \/>\n\tHint: Some lines were ellipsized, use -l to show in full.<br \/>\n\t[root@cm-awn01 scm_prepare_node.pFWkTK2i]#<\/span><br \/>\n\t&nbsp;\n<\/p>\n<p>\n\tThx,<br \/>\n\tTK<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>So you&#39;re getting this while trying to connect Cloud Hosts to your local Cloudera Infrastructure? WrongHost: Peer certificate subjectAltName does not match host, expected dhcp-100-0-0-100.remote.user.isp.com, got DNS:srv-c01.cdh.local.hst, DNS:cm-r01nn01.cdh.local.hst, DNS:cm-r01nn02.cdh.local.hst<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5403","post","type-post","status-publish","format-standard","hentry","category-unix-linux-admin-stuff"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/5403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/comments?post=5403"}],"version-history":[{"count":2,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/5403\/revisions"}],"predecessor-version":[{"id":5405,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/5403\/revisions\/5405"}],"wp:attachment":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/media?parent=5403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/categories?post=5403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/tags?post=5403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}