Printing PHP variable in form element in buildForm function
It's just a silly error '#markup' =&gt; t('$opensslOut') needs to be without the '' because $opensslOut is a variable and not a string. 

So use 

'#markup' =&gt; t($opensslOut)