Android Android MySQL SSL Configuration
#1
Kodi on Android does not appear to be attempting MySQL authentication using SSL/certificates.

Setup, 4 Amazon Fire TV Sticks w/ Kodi sideloaded, works perfect. Shared library via MySQL database setup correctly, Kodi connects and builds database/libraries perfect using non-ssl MySQL. I am migrating my database server to a location that requires me to cross insecure networks so having the communication SSL'd is a requirement.

Database server is configured to only accept SSL communication.

advancedsettings.xml (with host,user,password removed to protect the innocent), certificate files are in the userdata folder where advancedsettings.xml is located, have also attempted to use full path to cert files (/sdcard/Android/...)
Quote:<advancedsettings>
<network>
<buffermode>1</buffermode>
<cachemembuffersize>157286400</cachemembuffersize>
<readbufferfactor>20</readbufferfactor>
</network>
<videodatabase>
<type>mysql</type>
<host>MYSQLHOST</host>
<port>3306</port>
<user>KODIUSER</user>
<pass>KODIPASSWORD</pass>
<key>client-key.pem</key>
<cert>client-cert.pem</cert>
<ca>server-cert.pem</ca>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>MYSQLHOST</host>
<port>3306</port>
<user>KODIUSER</user>
<pass>KODIPASSWORD</pass>
<key>client-key.pem</key>
<cert>client-cert.pem</cert>
<ca>server-cert.pem</ca>
</musicdatabase>
<videolibrary>
<importwatchedstate>true</importwatchedstate>
<importresumepoint>true</importresumepoint>
</videolibrary>
</advancedsettings>

kodi.log (with some bits removed to protect the innocent)
Quote:
22:23:00 T:1457742536 NOTICE: special://profile/ is mapped to: special://masterprofile/
22:23:00 T:1457742536 NOTICE: -----------------------------------------------------------------------
22:23:00 T:1457742536 NOTICE: Starting Kodi (15.2 Git:2015-10-19-02e7013). Platform: Android ARM 32-bit
22:23:00 T:1457742536 NOTICE: Using Release Kodi x32 build
22:23:00 T:1457742536 NOTICE: Kodi compiled Oct 19 2015 by GCC 4.8.0 for Android ARM 32-bit API level 17 (API level 17)
22:23:00 T:1457742536 NOTICE: Running on Amazon AFTM with Android 4.2.2 API level 17, kernel: Linux ARM 32-bit version 3.0.31+
22:23:00 T:1457742536 NOTICE: FFmpeg version: 2.6.4-kodi-2.6.4-Isengard
22:23:00 T:1457742536 NOTICE: Host CPU: ARMv7 Processor rev 0 (v7l), 2 cores available
22:23:00 T:1457742536 NOTICE: Product: montoya, Device: montoya, Board: capri - Manufacturer: Amazon, Brand: BRCM, Model: AFTM, Hardware: montoya
22:23:00 T:1457742536 NOTICE: External storage path = /storage/emulated/0; status = ok
22:23:00 T:1457742536 NOTICE: ARM Features: Neon enabled
22:23:00 T:1457742536 NOTICE: special://xbmc/ is mapped to: /data/data/org.xbmc.kodi/cache/apk/assets
22:23:00 T:1457742536 NOTICE: special://xbmcbin/ is mapped to: /data/data/org.xbmc.kodi/cache/apk/assets
22:23:00 T:1457742536 NOTICE: special://masterprofile/ is mapped to: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata
22:23:00 T:1457742536 NOTICE: special://home/ is mapped to: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi
22:23:00 T:1457742536 NOTICE: special://temp/ is mapped to: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/temp
22:23:00 T:1457742536 NOTICE: The executable running is:
22:23:00 T:1457742536 NOTICE: Local hostname: localhost
22:23:00 T:1457742536 NOTICE: Log File is located: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/temp/kodi.log
22:23:00 T:1457742536 NOTICE: -----------------------------------------------------------------------
22:23:00 T:1457742536 NOTICE: load settings...
22:23:00 T:1457742536 DEBUG: CSettings: loaded settings definition from special://xbmc/system/settings/settings.xml
22:23:00 T:1457742536 WARNING: CSettingInt: unknown options filler "audiocdactions" of "audiocds.autoaction"
22:23:00 T:1457742536 DEBUG: CSettings: loaded settings definition from special://xbmc/system/settings/android.xml
22:23:00 T:1457742536 DEBUG: AESinkAUDIOTRACK - 44100 supported
22:23:00 T:1457742536 DEBUG: AESinkAUDIOTRACK - 48000 supported
22:23:00 T:1457742536 NOTICE: Found 1 Lists of Devices
22:23:00 T:1457742536 NOTICE: Enumerated AUDIOTRACK devices:
22:23:00 T:1457742536 NOTICE: Device 1
22:23:00 T:1457742536 NOTICE: m_deviceName : AudioTrack
22:23:00 T:1457742536 NOTICE: m_displayName : android
22:23:00 T:1457742536 NOTICE: m_displayNameExtra: audiotrack
22:23:00 T:1457742536 NOTICE: m_deviceType : AE_DEVTYPE_HDMI
22:23:00 T:1457742536 NOTICE: m_channels : FL,FR,FC,LFE,BL,BR
22:23:00 T:1457742536 NOTICE: m_sampleRates : 44100,48000
22:23:00 T:1457742536 NOTICE: m_dataFormats : AE_FMT_S16LE,AE_FMT_AC3,AE_FMT_DTS
22:23:00 T:1457742536 NOTICE: No settings file to load (special://xbmc/system/advancedsettings.xml)
22:23:00 T:1457742536 NOTICE: Loaded settings file from special://profile/advancedsettings.xml
22:23:00 T:1457742536 NOTICE: Contents of special://profile/advancedsettings.xml are...
<advancedsettings>
<network>
<buffermode>1</buffermode>
<cachemembuffersize>157286400</cachemembuffersize>
<readbufferfactor>20</readbufferfactor>
</network>
<videodatabase>
<type>mysql</type>
<host>MYSQLHOST</host>
<port>3306</port>
<user>KODIUSER</user>
<pass>KODIPASSWORD</pass>
<key>client-key.pem</key>
<cert>client-cert.pem</cert>
<ca>server-cert.pem</ca>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>MYSQLHOST</host>
<port>3306</port>
<user>KODIUSER</user>
<pass>KODIPASSWORD</pass>
<key>client-key.pem</key>
<cert>client-cert.pem</cert>
<ca>server-cert.pem</ca>
</musicdatabase>
<videolibrary>
<importwatchedstate>true</importwatchedstate>
<importresumepoint>true</importresumepoint>
</videolibrary>
</advancedsettings>
22:23:00 T:1457742536 WARNING: VIDEO database configuration is experimental.
22:23:00 T:1457742536 NOTICE: Default DVD Player: dvdplayer
22:23:00 T:1457742536 NOTICE: Default Video Player: dvdplayer
22:23:00 T:1457742536 NOTICE: Default Audio Player: paplayer
22:23:00 T:1457742536 NOTICE: Disabled debug logging due to GUI setting. Level 0.
22:23:00 T:1457742536 NOTICE: Log level changed to "LOG_LEVEL_NORMAL"
22:23:00 T:1457742536 NOTICE: CMediaSourceSettings: loading media sources from special://masterprofile/sources.xml
22:23:00 T:1457742536 NOTICE: Loading player core factory settings from special://xbmc/system/playercorefactory.xml.
22:23:01 T:1457742536 NOTICE: Loaded playercorefactory configuration
22:23:01 T:1457742536 NOTICE: Loading player core factory settings from special://masterprofile/playercorefactory.xml.
22:23:01 T:1457742536 NOTICE: special://masterprofile/playercorefactory.xml does not exist. Skipping.
22:23:01 T:1367919688 NOTICE: Thread ActiveAE start, auto delete: false
22:23:01 T:1363551600 NOTICE: Thread AESink start, auto delete: false
22:23:01 T:1457742536 NOTICE: Running database version Addons19
22:23:01 T:1457742536 NOTICE: ADDONS: Using repository repository.xbmc.org
22:23:01 T:1457742536 NOTICE: virtual bool CWinSystemEGL::InitWindowSystem(): Using EGL Implementation: android
22:23:01 T:1457742536 NOTICE: Current resolution: 1920x1080 @ 60.00 - Full Screen
22:23:01 T:1457742536 NOTICE: Previous line repeats 1 times.
22:23:01 T:1457742536 NOTICE: Found resolution 1920 x 1080 for display 0 with 1920 x 1080 @ 59.999996 Hz
22:23:01 T:1457742536 NOTICE: Found ([email protected]) at 16, setting to RES_DESKTOP at 16
22:23:01 T:1457742536 NOTICE: Checking resolution 16
22:23:01 T:1457742536 NOTICE: Current resolution: 1920x1080 @ 60.00 - Full Screen
22:23:01 T:1457742536 NOTICE: GL_VENDOR = Broadcom
22:23:01 T:1457742536 NOTICE: GL_RENDERER = VideoCore IV HW
22:23:01 T:1457742536 NOTICE: GL_VERSION = OpenGL ES 2.0
22:23:01 T:1457742536 NOTICE: GL_SHADING_LANGUAGE_VERSION = OpenGL ES GLSL ES 1.00
22:23:01 T:1457742536 NOTICE: GL_EXTENSIONS = GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_debug_marker
22:23:01 T:1457742536 NOTICE: Current resolution: 1920x1080 @ 60.00 - Full Screen
22:23:01 T:1457742536 WARNING: Unable to resolve: /libcec.so CECInitialise, reason: Symbol not found:
22:23:01 T:1457742536 ERROR: Unable to resolve exports from dll libcec.so
22:23:01 T:1457742536 ERROR: virtual void PERIPHERALS::CPeripherals::Initialise() - failed to initialise bus cec
22:23:01 T:1485141696 NOTICE: Thread PeripBusUSB start, auto delete: false
22:23:01 T:1457742536 NOTICE: Running database version Addons19
22:23:01 T:1457742536 NOTICE: Running database version ViewModes6
22:23:01 T:1457742536 NOTICE: Running database version Textures13
22:23:02 T:1457742536 ERROR: Unable to open database: MyMusic52 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:02 T:1457742536 ERROR: Unable to open database: MyMusic51 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:02 T:1457742536 ERROR: Unable to open database: MyMusic50 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:02 T:1457742536 ERROR: Unable to open database: MyMusic49 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:02 T:1457742536 ERROR: Unable to open database: MyMusic48 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:03 T:1457742536 ERROR: Unable to open database: MyMusic47 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:03 T:1457742536 ERROR: Unable to open database: MyMusic46 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:03 T:1457742536 ERROR: Unable to open database: MyMusic45 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:03 T:1457742536 ERROR: Unable to open database: MyMusic44 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:04 T:1457742536 ERROR: Unable to open database: MyMusic43 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:04 T:1457742536 ERROR: Unable to open database: MyMusic42 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:04 T:1457742536 ERROR: Unable to open database: MyMusic41 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:04 T:1457742536 ERROR: Unable to open database: MyMusic40 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:04 T:1457742536 ERROR: Unable to open database: MyMusic39 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:05 T:1457742536 ERROR: Unable to open database: MyMusic38 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:05 T:1457742536 ERROR: Unable to open database: MyMusic37 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:05 T:1457742536 ERROR: Unable to open database: MyMusic36 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:05 T:1457742536 ERROR: Unable to open database: MyMusic35 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:05 T:1457742536 ERROR: Unable to open database: MyMusic34 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic33 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic32 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic31 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic30 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic29 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:06 T:1457742536 ERROR: Unable to open database: MyMusic28 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:07 T:1457742536 ERROR: Unable to open database: MyMusic27 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:07 T:1457742536 ERROR: Unable to open database: MyMusic26 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:07 T:1457742536 ERROR: Unable to open database: MyMusic25 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:07 T:1457742536 ERROR: Unable to open database: MyMusic24 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:07 T:1457742536 ERROR: Unable to open database: MyMusic23 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:08 T:1457742536 ERROR: Unable to open database: MyMusic22 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:08 T:1457742536 ERROR: Unable to open database: MyMusic21 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:08 T:1457742536 ERROR: Unable to open database: MyMusic20 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:08 T:1457742536 ERROR: Unable to open database: MyMusic19 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:08 T:1457742536 ERROR: Unable to open database: MyMusic18 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:09 T:1457742536 ERROR: Unable to open database: MyMusic52 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:09 T:1457742536 ERROR: Unable to create new database
22:23:09 T:1457742536 ERROR: Unable to open database: MyVideos93 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:09 T:1457742536 ERROR: Unable to open database: MyVideos92 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:09 T:1457742536 ERROR: Unable to open database: MyVideos91 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:09 T:1457742536 ERROR: Unable to open database: MyVideos90 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos89 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos88 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos87 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos86 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos85 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:10 T:1457742536 ERROR: Unable to open database: MyVideos84 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:11 T:1457742536 ERROR: Unable to open database: MyVideos83 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:11 T:1457742536 ERROR: Unable to open database: MyVideos82 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:11 T:1457742536 ERROR: Unable to open database: MyVideos81 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:11 T:1457742536 ERROR: Unable to open database: MyVideos80 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:11 T:1457742536 ERROR: Unable to open database: MyVideos79 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:12 T:1457742536 ERROR: Unable to open database: MyVideos78 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:12 T:1457742536 ERROR: Unable to open database: MyVideos77 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:12 T:1457742536 ERROR: Unable to open database: MyVideos76 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:12 T:1457742536 ERROR: Unable to open database: MyVideos75 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:12 T:1457742536 ERROR: Unable to open database: MyVideos74 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos73 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos72 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos71 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos70 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos69 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:13 T:1457742536 ERROR: Unable to open database: MyVideos68 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:14 T:1457742536 ERROR: Unable to open database: MyVideos67 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:14 T:1457742536 ERROR: Unable to open database: MyVideos66 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:14 T:1457742536 ERROR: Unable to open database: MyVideos65 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:14 T:1457742536 ERROR: Unable to open database: MyVideos64 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to open database: MyVideos63 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to open database: MyVideos62 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to open database: MyVideos61 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to open database: MyVideos60 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to open database: MyVideos93 [1045](Access denied for user 'KODIUSER'@'KODIIPADDRESS' (using password: YES))
22:23:15 T:1457742536 ERROR: Unable to create new database

I can confirm that MySQL authentication via ssl certificates works for user account via:
Quote:[USER@LINUXHOST ~]$ mysql --ssl-ca=server-cert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem -u KODIUSER -p -h MYSQLHOST
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 7178
Server version: 5.6.25

Copyright © 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]>

At first I assumed that ssl support added from git pull 2566 was not incorporated to the kodi-android build, but after pulling and browsing the source, all the relevant bits seem to be included. Which makes me think I'm just doing this wrong, any ideas??

Thanks!
Reply
#2
can you enable debugging? Maybe we can see more errors with a full debug log (like cant read certificate or something)

Cheers!
Reply
#3
Doh good call, will try tonight and report back what I find.
Reply
#4
No MySql + SSL on Android, as a matter of fact.
Before you ask, I don't know why nor what it'd take to enable it.
Reply
#5
Yeah I discovered this last night after debugging provided no additional details and I decided to check the makefile for mysql. As far as i can tell all the necessary bits are in the kodi source code just the mysql client built for kodi-android is not compiled with ssl support. My build machine is currently chugging away on an apk with mysql ssl support compiled in.

I'll report back.
Reply
#6
Success.

Recompiled with my modified Makefile for mysql and now have SSL'd mysql connectivity from Kodi on Android.

Thanks for the support guys! Smile
Reply
#7
Well, sharing your changes would be nice Wink
Reply
#8
(2015-12-20, 02:55)Koying Wrote: Well, sharing your changes would be nice Wink


No problem, really simple change. Like I said before, all the relevant bits from pull 2566 were already included in the source (adding ssl support, adding relevant config items to advancedsettings.xml, etc) it was just that the mysql client that is compiled as a dependency to Kodi during the Android build is compiled without ssl support. The following is the change I made to tools/depends/target/mysql/Makefile:

Makefile.patch Wrote:--enable-thread-safe-client --with-extra-charsets=complex \
--with-named-thread-libs=-lc --with-named-curses-libs=-lncurses \
--with-libedit \
- --without-server --without-bench --without-docs --without-man --disable-shared
+ --without-server --without-bench --without-docs --without-man --disable-shared --with-ssl=$(PREFIX) LIBS=-lz

LIBDYLIB=$(PLATFORM)/lib$(LIBNAME)/.libs/lib$(LIBNAME)client.a

After that change is made it's just a standard Kodi for Android build (as detailed in the README). Hope this helps anyone else looking for SSL'd MySQL communication on Kodi for Android (also, as you can tell from above I added libz support as well, since my database is across the internet now I want every bit of performance I can get). Also if anyone wants, I can share my APK as well (15.2). As soon as a stable 16.0 is released I plan on compiling that as well.
Reply
#9
Thanks for this.

For reference, did you use a full path to the cert/key/ca files?
Reply
#10
(2015-12-20, 11:16)Koying Wrote: Thanks for this.

For reference, did you use a full path to the cert/key/ca files?

Full path, I attempted using just the file names but that did not work.

Should not be required but for completeness sake I also added the <ciphers>ECDHE-RSA-AES256-SHA</ciphers> directive to my advancedsettings.xml based on what my successful connection from a linux box looked like:

Quote:[USER@LINUXHOST ~]$ mysql --ssl-ca=server-cert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem -u KODIUSER -p -h MYSQLIPADDRESS
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 19538
Server version: 5.6.25-google (Google)

Copyright © 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> \s
--------------
mysql Ver 15.1 Distrib 5.5.44-MariaDB, for Linux (x86_64) using readline 5.1

Connection id: 19538
Current database:
Current user: KODIUSER@KODIIPADDRESS
SSL: Cipher in use is ECDHE-RSA-AES256-SHA
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MySQL
Server version: 5.6.25-google (Google)
Protocol version: 10
Connection: MYSQLIPADDRESS via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 5 days 12 hours 35 min 33 sec

Threads: 2 Questions: 471615 Slow queries: 0 Opens: 228 Flush tables: 1 Open tables: 126 Queries per second avg: 0.988
--------------
Reply
#11
is this on android by default now? kodi18 that is

edit: yes it is
Reply

Logout Mark Read Team Forum Stats Members Help
Android MySQL SSL Configuration0