Why don't parameters generated by dhparams conform to `(2^p) mod (p-1)/2 == 1`? I've used openssl dhparams to generate 512-bit DH parameters for a test. The resulting file is:

-----BEGIN DH PARAMETERS-----
MEYCQQDgkQsR2SuYabxysYaxk2oB2Us+YKNbEBQCdhBzMZ/5fb1s80PBDsch5gRD
A5TLoOG/XOc9hr6MXhNu2A6/WzZ7AgEC
-----END DH PARAMETERS-----
Vs-MacBook:LRS v$ openssl asn1parse -in dh512.pem
    0:d=0  hl=2 l=  70 cons: SEQUENCE
    2:d=1  hl=2 l=  65 prim: INTEGER           :E0910B11D92B9869BC72B186B1936A01D94B3E60A35B101402761073319FF97DBD6CF343C10EC721E604430394CBA0E1BF5CE73D86BE8C5E136ED80EBF5B367B
   69:d=1  hl=2 l=   1 prim: INTEGER           :02


Yet, if we take those numbers, and compute (2 ^ prime) % ((prime-1)/2),

the result is not 1, which I thought should be the case. ​ Why?
OpenSSL prefers groups where $g$ (in this case, $2$) is a generator, that is $2^x \bmod p$ can take on $p-1$ distinct values (depending on $x$).  Because of this, $2^{(p-1)/2}$ can't be 1, as if it were, $2^x$ could take on, at most, $(p-1)/2$ values.

In the $g=2$ case, and where $p$ is a "safe prime" (that is, $(p-1)/2$ is also prime), then there's a simple rule; if $p \equiv 3 \bmod 8$, then $2$ will generate the entire group (and so $2^{(p-1)/2} \not\equiv 1$); if $p \equiv 7 \bmod 8$, then $2$ will generate only half the possible elements (and so $2 ^{(p-1)/2} \equiv 1$.  A quick examination of the last hex digit of $p$ (B) gives us $p \equiv 3 \bmod 8$. 

The obvious question would be "what does this matter for security"?  Well, this observation allows the attacker to deduce the lsbit of each side's DH private exponent; however it doesn't do anything other than that.  Some (including me) would question why it's necessary to reveal anything at all about the private exponent; the OpenSSL people thought that minor leakage was acceptable.

Now, if you're proposing to use the group for something other than DH, this may matter to you; however it's hard to complain that a tool doesn't work for a use it was never designed for.  On the other hand, if you need a $g$ which generates the subgroup of size $(p-1)/2$, there's always $g=4$