KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Be careful which files you store as PEM next to the structure
PRODUCT: 4D | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: September 18, 2014

PEM files are a special type of file relating to SSL. These files, when placed next to the 4D structure file, are automatically parsed by 4D when the structure file is opened.

Typically only the private key (key.pem) and signed certificate (cert.pem) files are needed:

key.PEM (private key)
cert.PEM (signed certificate)

...but sometimes an intermediate certificate is also needed (may also be referred as a chained certificate):

In previous versions of 4D the intermediary certificate needed to be appended to the signed certificate file as described Tech Tip: Using Chained SSL Certificates in 4th Dimension and Tech Tip: Installing a VeriSign Intermediate Certificate for 4D Business Kit 2.1.

This changed starting with 4D v14 because any PEM file other than key.pem and cert.pem is treated like an intermediary certificate. Simply store the intermediary certificate with a PEM extension next to the structure file to have it parsed automatically.

On the other hand, the PUBLIC key should not be saved with a PEM extension. If you store the public key as a PEM file next to the structure you may see an error like this:

Error<br /><br />Failed to get SSL certificate<br /><br />Error code: 45<br />Failed to get SSL certificate<br />component: 'srvr'<br />task -1, name: 'User Interface'<br /><br />Error code: 49<br />SSL internal error : error:0906D06C:PEM routines:PEM_read_bio:no start line<br />component: 'srvr'<br />task -1, name: 'User Interface'<br /><br />Error code: 49<br />SSL internal error : error:0906D06C:PEM routines:PEM_read_bio:no start line<br />component: 'srvr'<br />task -1, name: 'User Interface'

The solution for this is to either remove the public_key.pem file (it is not needed by 4D) or to rename the public_key.pem file to something else, such as public_key.txt