We present a method for optimization of optical coherence tomography images using wavefront sensorless adaptive optics. The method consists of systematic adjustment of the coefficients of a subset of the orthogonal Zernike bases and application of the resulting shapes to a deformable mirror, while optimizing using image sharpness as a merit function. We demonstrate that this technique can compensate for aberrations induced by trial lenses. Measurements of the point spread function before and after compensation demonstrate near diffraction limit imaging.