test_ftplib: skip check_hostname test when SNI is not available
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 15458a8..7f3bebf 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -15,6 +15,9 @@
     import ssl
 except ImportError:
     ssl = None
+    HAS_SNI = False
+else:
+    from ssl import HAS_SNI
 
 from unittest import TestCase, skipUnless
 from test import support
@@ -924,6 +927,7 @@
         self.client.ccc()
         self.assertRaises(ValueError, self.client.sock.unwrap)
 
+    @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
     def test_check_hostname(self):
         self.client.quit()
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)